File tree Expand file tree Collapse file tree 12 files changed +48
-30
lines changed
Expand file tree Collapse file tree 12 files changed +48
-30
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,11 @@ RUN apt-get update \
4040 postgresql-contrib-$PG_MAJOR=$PG_VERSION \
4141 && rm -rf /var/lib/apt/lists/*
4242
43+ # make the sample config easier to munge (and "correct by default")
44+ RUN mv -v /usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample /usr/share/postgresql/ \
45+ && ln -sv ../postgresql.conf.sample /usr/share/postgresql/$PG_MAJOR/ \
46+ && sed -ri "s!^#?(listen_addresses)\s *=\s *\S +.*!\1 = '*'!" /usr/share/postgresql/postgresql.conf.sample
47+
4348RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
4449
4550ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -e
33
4- set_listen_addresses () {
5- sedEscapedValue=" $( echo " $1 " | sed ' s/[\/&]/\\&/g' ) "
6- sed -ri " s/^#?(listen_addresses\s*=\s*)\S+/\1'$sedEscapedValue '/" " $PGDATA /postgresql.conf"
7- }
4+ if [ " ${1: 0: 1} " = ' -' ]; then
5+ set -- postgres " $@ "
6+ fi
87
98if [ " $1 " = ' postgres' ]; then
109 mkdir -p " $PGDATA "
@@ -88,7 +87,6 @@ if [ "$1" = 'postgres' ]; then
8887 done
8988
9089 gosu postgres pg_ctl -D " $PGDATA " -m fast -w stop
91- set_listen_addresses ' *'
9290
9391 echo
9492 echo ' PostgreSQL init process complete; ready for start up.'
Original file line number Diff line number Diff line change @@ -40,6 +40,11 @@ RUN apt-get update \
4040 postgresql-contrib-$PG_MAJOR=$PG_VERSION \
4141 && rm -rf /var/lib/apt/lists/*
4242
43+ # make the sample config easier to munge (and "correct by default")
44+ RUN mv -v /usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample /usr/share/postgresql/ \
45+ && ln -sv ../postgresql.conf.sample /usr/share/postgresql/$PG_MAJOR/ \
46+ && sed -ri "s!^#?(listen_addresses)\s *=\s *\S +.*!\1 = '*'!" /usr/share/postgresql/postgresql.conf.sample
47+
4348RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
4449
4550ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -e
33
4- set_listen_addresses () {
5- sedEscapedValue=" $( echo " $1 " | sed ' s/[\/&]/\\&/g' ) "
6- sed -ri " s/^#?(listen_addresses\s*=\s*)\S+/\1'$sedEscapedValue '/" " $PGDATA /postgresql.conf"
7- }
4+ if [ " ${1: 0: 1} " = ' -' ]; then
5+ set -- postgres " $@ "
6+ fi
87
98if [ " $1 " = ' postgres' ]; then
109 mkdir -p " $PGDATA "
@@ -88,7 +87,6 @@ if [ "$1" = 'postgres' ]; then
8887 done
8988
9089 gosu postgres pg_ctl -D " $PGDATA " -m fast -w stop
91- set_listen_addresses ' *'
9290
9391 echo
9492 echo ' PostgreSQL init process complete; ready for start up.'
Original file line number Diff line number Diff line change @@ -40,6 +40,11 @@ RUN apt-get update \
4040 postgresql-contrib-$PG_MAJOR=$PG_VERSION \
4141 && rm -rf /var/lib/apt/lists/*
4242
43+ # make the sample config easier to munge (and "correct by default")
44+ RUN mv -v /usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample /usr/share/postgresql/ \
45+ && ln -sv ../postgresql.conf.sample /usr/share/postgresql/$PG_MAJOR/ \
46+ && sed -ri "s!^#?(listen_addresses)\s *=\s *\S +.*!\1 = '*'!" /usr/share/postgresql/postgresql.conf.sample
47+
4348RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
4449
4550ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -e
33
4- set_listen_addresses () {
5- sedEscapedValue=" $( echo " $1 " | sed ' s/[\/&]/\\&/g' ) "
6- sed -ri " s/^#?(listen_addresses\s*=\s*)\S+/\1'$sedEscapedValue '/" " $PGDATA /postgresql.conf"
7- }
4+ if [ " ${1: 0: 1} " = ' -' ]; then
5+ set -- postgres " $@ "
6+ fi
87
98if [ " $1 " = ' postgres' ]; then
109 mkdir -p " $PGDATA "
@@ -88,7 +87,6 @@ if [ "$1" = 'postgres' ]; then
8887 done
8988
9089 gosu postgres pg_ctl -D " $PGDATA " -m fast -w stop
91- set_listen_addresses ' *'
9290
9391 echo
9492 echo ' PostgreSQL init process complete; ready for start up.'
Original file line number Diff line number Diff line change @@ -40,6 +40,11 @@ RUN apt-get update \
4040 postgresql-contrib-$PG_MAJOR=$PG_VERSION \
4141 && rm -rf /var/lib/apt/lists/*
4242
43+ # make the sample config easier to munge (and "correct by default")
44+ RUN mv -v /usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample /usr/share/postgresql/ \
45+ && ln -sv ../postgresql.conf.sample /usr/share/postgresql/$PG_MAJOR/ \
46+ && sed -ri "s!^#?(listen_addresses)\s *=\s *\S +.*!\1 = '*'!" /usr/share/postgresql/postgresql.conf.sample
47+
4348RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
4449
4550ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -e
33
4- set_listen_addresses () {
5- sedEscapedValue=" $( echo " $1 " | sed ' s/[\/&]/\\&/g' ) "
6- sed -ri " s/^#?(listen_addresses\s*=\s*)\S+/\1'$sedEscapedValue '/" " $PGDATA /postgresql.conf"
7- }
4+ if [ " ${1: 0: 1} " = ' -' ]; then
5+ set -- postgres " $@ "
6+ fi
87
98if [ " $1 " = ' postgres' ]; then
109 mkdir -p " $PGDATA "
@@ -88,7 +87,6 @@ if [ "$1" = 'postgres' ]; then
8887 done
8988
9089 gosu postgres pg_ctl -D " $PGDATA " -m fast -w stop
91- set_listen_addresses ' *'
9290
9391 echo
9492 echo ' PostgreSQL init process complete; ready for start up.'
Original file line number Diff line number Diff line change @@ -40,6 +40,11 @@ RUN apt-get update \
4040 postgresql-contrib-$PG_MAJOR=$PG_VERSION \
4141 && rm -rf /var/lib/apt/lists/*
4242
43+ # make the sample config easier to munge (and "correct by default")
44+ RUN mv -v /usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample /usr/share/postgresql/ \
45+ && ln -sv ../postgresql.conf.sample /usr/share/postgresql/$PG_MAJOR/ \
46+ && sed -ri "s!^#?(listen_addresses)\s *=\s *\S +.*!\1 = '*'!" /usr/share/postgresql/postgresql.conf.sample
47+
4348RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
4449
4550ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -e
33
4- set_listen_addresses () {
5- sedEscapedValue=" $( echo " $1 " | sed ' s/[\/&]/\\&/g' ) "
6- sed -ri " s/^#?(listen_addresses\s*=\s*)\S+/\1'$sedEscapedValue '/" " $PGDATA /postgresql.conf"
7- }
4+ if [ " ${1: 0: 1} " = ' -' ]; then
5+ set -- postgres " $@ "
6+ fi
87
98if [ " $1 " = ' postgres' ]; then
109 mkdir -p " $PGDATA "
@@ -88,7 +87,6 @@ if [ "$1" = 'postgres' ]; then
8887 done
8988
9089 gosu postgres pg_ctl -D " $PGDATA " -m fast -w stop
91- set_listen_addresses ' *'
9290
9391 echo
9492 echo ' PostgreSQL init process complete; ready for start up.'
You can’t perform that action at this time.
0 commit comments