From: W. Trevor King Date: Fri, 3 Jan 2014 19:39:58 +0000 (-0800) Subject: postgresql/Dockerfile.template: Log to syslog X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f70f6a18df7ff34c2f3817a182611ab1b7d16ac3;p=dockerfile.git postgresql/Dockerfile.template: Log to syslog Also use sed to place the listen_addresses config near its associated comments in the config file. --- diff --git a/postgresql/Dockerfile.template b/postgresql/Dockerfile.template index e7c094b..2d7c84c 100644 --- a/postgresql/Dockerfile.template +++ b/postgresql/Dockerfile.template @@ -32,9 +32,12 @@ RUN yes | emerge --config dev-db/postgresql-server VOLUME ["/var/lib/postgresql"] # Expose PostgreSQL to external network connections -RUN echo "listen_addresses = '*'" >> $(echo /etc/postgresql*/postgresql.conf) +RUN sed -i "s/\(#listen_addresses =.*\)/listen_addresses = '*'\n\1/" /etc/postgresql*/postgresql.conf RUN echo host all all 0.0.0.0/0 trust >> $(echo /etc/postgresql*/pg_hba.conf) +# Setup logging +RUN sed -i "s/\(#log_destination =.*\)/log_destination = 'syslog'\n\1/" /etc/postgresql*/postgresql.conf + # Container networking happens automatically RUN sed -i 's/need net$/use net/' /etc/init.d/*