Skip to content

Commit 2184bbc

Browse files
committed
Run update.sh
1 parent 41e7a62 commit 2184bbc

10 files changed

+40
-25
lines changed

9.1/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ RUN apt-get update \
3636
postgresql-contrib-$PG_MAJOR=$PG_VERSION \
3737
&& rm -rf /var/lib/apt/lists/*
3838

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+
3944
RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
4045

4146
ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH

9.1/docker-entrypoint.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#!/bin/bash
22
set -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

98
if [ "$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.'

9.2/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ RUN apt-get update \
3636
postgresql-contrib-$PG_MAJOR=$PG_VERSION \
3737
&& rm -rf /var/lib/apt/lists/*
3838

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+
3944
RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
4045

4146
ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH

9.2/docker-entrypoint.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#!/bin/bash
22
set -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

98
if [ "$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.'

9.3/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ RUN apt-get update \
3636
postgresql-contrib-$PG_MAJOR=$PG_VERSION \
3737
&& rm -rf /var/lib/apt/lists/*
3838

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+
3944
RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
4045

4146
ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH

9.3/docker-entrypoint.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#!/bin/bash
22
set -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

98
if [ "$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.'

9.4/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ RUN apt-get update \
3636
postgresql-contrib-$PG_MAJOR=$PG_VERSION \
3737
&& rm -rf /var/lib/apt/lists/*
3838

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+
3944
RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
4045

4146
ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH

9.4/docker-entrypoint.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#!/bin/bash
22
set -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

98
if [ "$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.'

9.5/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ RUN apt-get update \
3636
postgresql-contrib-$PG_MAJOR=$PG_VERSION \
3737
&& rm -rf /var/lib/apt/lists/*
3838

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+
3944
RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
4045

4146
ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH

9.5/docker-entrypoint.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#!/bin/bash
22
set -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

98
if [ "$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.'

0 commit comments

Comments
 (0)