File tree 10 files changed +40
-25
lines changed
10 files changed +40
-25
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,11 @@ RUN apt-get update \
36
36
postgresql-contrib-$PG_MAJOR=$PG_VERSION \
37
37
&& rm -rf /var/lib/apt/lists/*
38
38
39
+ # make the sample config easier to munge (and "correct by default")
40
+ RUN mv -v /usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample /usr/share/postgresql/ \
41
+ && ln -sv ../postgresql.conf.sample /usr/share/postgresql/$PG_MAJOR/ \
42
+ && sed -ri "s!^#?(listen_addresses)\s *=\s *\S +.*!\1 = '*'!" /usr/share/postgresql/postgresql.conf.sample
43
+
39
44
RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
40
45
41
46
ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
set -e
3
3
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
8
7
9
8
if [ " $1 " = ' postgres' ]; then
10
9
mkdir -p " $PGDATA "
@@ -88,7 +87,6 @@ if [ "$1" = 'postgres' ]; then
88
87
done
89
88
90
89
gosu postgres pg_ctl -D " $PGDATA " -m fast -w stop
91
- set_listen_addresses ' *'
92
90
93
91
echo
94
92
echo ' PostgreSQL init process complete; ready for start up.'
Original file line number Diff line number Diff line change @@ -36,6 +36,11 @@ RUN apt-get update \
36
36
postgresql-contrib-$PG_MAJOR=$PG_VERSION \
37
37
&& rm -rf /var/lib/apt/lists/*
38
38
39
+ # make the sample config easier to munge (and "correct by default")
40
+ RUN mv -v /usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample /usr/share/postgresql/ \
41
+ && ln -sv ../postgresql.conf.sample /usr/share/postgresql/$PG_MAJOR/ \
42
+ && sed -ri "s!^#?(listen_addresses)\s *=\s *\S +.*!\1 = '*'!" /usr/share/postgresql/postgresql.conf.sample
43
+
39
44
RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
40
45
41
46
ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
set -e
3
3
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
8
7
9
8
if [ " $1 " = ' postgres' ]; then
10
9
mkdir -p " $PGDATA "
@@ -88,7 +87,6 @@ if [ "$1" = 'postgres' ]; then
88
87
done
89
88
90
89
gosu postgres pg_ctl -D " $PGDATA " -m fast -w stop
91
- set_listen_addresses ' *'
92
90
93
91
echo
94
92
echo ' PostgreSQL init process complete; ready for start up.'
Original file line number Diff line number Diff line change @@ -36,6 +36,11 @@ RUN apt-get update \
36
36
postgresql-contrib-$PG_MAJOR=$PG_VERSION \
37
37
&& rm -rf /var/lib/apt/lists/*
38
38
39
+ # make the sample config easier to munge (and "correct by default")
40
+ RUN mv -v /usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample /usr/share/postgresql/ \
41
+ && ln -sv ../postgresql.conf.sample /usr/share/postgresql/$PG_MAJOR/ \
42
+ && sed -ri "s!^#?(listen_addresses)\s *=\s *\S +.*!\1 = '*'!" /usr/share/postgresql/postgresql.conf.sample
43
+
39
44
RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
40
45
41
46
ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
set -e
3
3
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
8
7
9
8
if [ " $1 " = ' postgres' ]; then
10
9
mkdir -p " $PGDATA "
@@ -88,7 +87,6 @@ if [ "$1" = 'postgres' ]; then
88
87
done
89
88
90
89
gosu postgres pg_ctl -D " $PGDATA " -m fast -w stop
91
- set_listen_addresses ' *'
92
90
93
91
echo
94
92
echo ' PostgreSQL init process complete; ready for start up.'
Original file line number Diff line number Diff line change @@ -36,6 +36,11 @@ RUN apt-get update \
36
36
postgresql-contrib-$PG_MAJOR=$PG_VERSION \
37
37
&& rm -rf /var/lib/apt/lists/*
38
38
39
+ # make the sample config easier to munge (and "correct by default")
40
+ RUN mv -v /usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample /usr/share/postgresql/ \
41
+ && ln -sv ../postgresql.conf.sample /usr/share/postgresql/$PG_MAJOR/ \
42
+ && sed -ri "s!^#?(listen_addresses)\s *=\s *\S +.*!\1 = '*'!" /usr/share/postgresql/postgresql.conf.sample
43
+
39
44
RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
40
45
41
46
ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
set -e
3
3
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
8
7
9
8
if [ " $1 " = ' postgres' ]; then
10
9
mkdir -p " $PGDATA "
@@ -88,7 +87,6 @@ if [ "$1" = 'postgres' ]; then
88
87
done
89
88
90
89
gosu postgres pg_ctl -D " $PGDATA " -m fast -w stop
91
- set_listen_addresses ' *'
92
90
93
91
echo
94
92
echo ' PostgreSQL init process complete; ready for start up.'
Original file line number Diff line number Diff line change @@ -36,6 +36,11 @@ RUN apt-get update \
36
36
postgresql-contrib-$PG_MAJOR=$PG_VERSION \
37
37
&& rm -rf /var/lib/apt/lists/*
38
38
39
+ # make the sample config easier to munge (and "correct by default")
40
+ RUN mv -v /usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample /usr/share/postgresql/ \
41
+ && ln -sv ../postgresql.conf.sample /usr/share/postgresql/$PG_MAJOR/ \
42
+ && sed -ri "s!^#?(listen_addresses)\s *=\s *\S +.*!\1 = '*'!" /usr/share/postgresql/postgresql.conf.sample
43
+
39
44
RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
40
45
41
46
ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
set -e
3
3
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
8
7
9
8
if [ " $1 " = ' postgres' ]; then
10
9
mkdir -p " $PGDATA "
@@ -88,7 +87,6 @@ if [ "$1" = 'postgres' ]; then
88
87
done
89
88
90
89
gosu postgres pg_ctl -D " $PGDATA " -m fast -w stop
91
- set_listen_addresses ' *'
92
90
93
91
echo
94
92
echo ' PostgreSQL init process complete; ready for start up.'
You can’t perform that action at this time.
0 commit comments