Skip to content

Commit

Permalink
Use "/var/run/postgresql" consistently (and apply Debian's change of …
Browse files Browse the repository at this point in the history
…the default socket path to Alpine also)
  • Loading branch information
tianon committed Jan 19, 2017
1 parent a7a6cdf commit b68154e
Show file tree
Hide file tree
Showing 23 changed files with 109 additions and 56 deletions.
3 changes: 2 additions & 1 deletion 9.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ RUN mv -v /usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample /usr/share/post
&& ln -sv ../postgresql.conf.sample /usr/share/postgresql/$PG_MAJOR/ \
&& sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/share/postgresql/postgresql.conf.sample

RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod g+s /var/run/postgresql

ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
ENV PGDATA /var/lib/postgresql/data
RUN mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA" && chmod 700 "$PGDATA"
VOLUME /var/lib/postgresql/data

COPY docker-entrypoint.sh /
Expand Down
8 changes: 7 additions & 1 deletion 9.2/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ RUN set -ex \
zlib-dev \
\
&& cd /usr/src/postgresql \
# update "DEFAULT_PGSOCKET_DIR" to "/var/run/postgresql" (matching Debian)
# see https://anonscm.debian.org/git/pkg-postgresql/postgresql.git/tree/debian/patches/51-default-sockets-in-var.patch?id=8b539fcb3e093a521c095e70bdfa76887217b89f
&& awk '$1 == "#define" && $2 == "DEFAULT_PGSOCKET_DIR" && $3 == "\"/tmp\"" { $3 = "\"/var/run/postgresql\""; print; next } { print }' src/include/pg_config_manual.h > src/include/pg_config_manual.h.new \
&& grep '/var/run/postgresql' src/include/pg_config_manual.h.new \
&& mv src/include/pg_config_manual.h.new src/include/pg_config_manual.h \
# configure options taken from:
# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5
&& ./configure \
Expand Down Expand Up @@ -113,10 +118,11 @@ RUN set -ex \
# make the sample config easier to munge (and "correct by default")
RUN sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample

RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod g+s /var/run/postgresql

ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
ENV PGDATA /var/lib/postgresql/data
RUN mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA" && chmod 700 "$PGDATA"
VOLUME /var/lib/postgresql/data

COPY docker-entrypoint.sh /
Expand Down
9 changes: 5 additions & 4 deletions 9.2/alpine/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ fi

if [ "$1" = 'postgres' ]; then
mkdir -p "$PGDATA"
chmod 700 "$PGDATA"
chown -R postgres "$PGDATA"
chmod 700 "$PGDATA"

mkdir -p /var/run/postgresql
chown -R postgres /var/run/postgresql
chmod g+s /var/run/postgresql

mkdir -p /run/postgresql
chmod g+s /run/postgresql
chown -R postgres /run/postgresql

# look specifically for PG_VERSION, as it is expected in the DB dir
if [ ! -s "$PGDATA/PG_VERSION" ]; then
Expand Down
9 changes: 5 additions & 4 deletions 9.2/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ fi

if [ "$1" = 'postgres' ]; then
mkdir -p "$PGDATA"
chmod 700 "$PGDATA"
chown -R postgres "$PGDATA"
chmod 700 "$PGDATA"

mkdir -p /var/run/postgresql
chown -R postgres /var/run/postgresql
chmod g+s /var/run/postgresql

mkdir -p /run/postgresql
chmod g+s /run/postgresql
chown -R postgres /run/postgresql

# look specifically for PG_VERSION, as it is expected in the DB dir
if [ ! -s "$PGDATA/PG_VERSION" ]; then
Expand Down
3 changes: 2 additions & 1 deletion 9.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ RUN mv -v /usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample /usr/share/post
&& ln -sv ../postgresql.conf.sample /usr/share/postgresql/$PG_MAJOR/ \
&& sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/share/postgresql/postgresql.conf.sample

RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod g+s /var/run/postgresql

ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
ENV PGDATA /var/lib/postgresql/data
RUN mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA" && chmod 700 "$PGDATA"
VOLUME /var/lib/postgresql/data

COPY docker-entrypoint.sh /
Expand Down
8 changes: 7 additions & 1 deletion 9.3/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ RUN set -ex \
zlib-dev \
\
&& cd /usr/src/postgresql \
# update "DEFAULT_PGSOCKET_DIR" to "/var/run/postgresql" (matching Debian)
# see https://anonscm.debian.org/git/pkg-postgresql/postgresql.git/tree/debian/patches/51-default-sockets-in-var.patch?id=8b539fcb3e093a521c095e70bdfa76887217b89f
&& awk '$1 == "#define" && $2 == "DEFAULT_PGSOCKET_DIR" && $3 == "\"/tmp\"" { $3 = "\"/var/run/postgresql\""; print; next } { print }' src/include/pg_config_manual.h > src/include/pg_config_manual.h.new \
&& grep '/var/run/postgresql' src/include/pg_config_manual.h.new \
&& mv src/include/pg_config_manual.h.new src/include/pg_config_manual.h \
# configure options taken from:
# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5
&& ./configure \
Expand Down Expand Up @@ -113,10 +118,11 @@ RUN set -ex \
# make the sample config easier to munge (and "correct by default")
RUN sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample

RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod g+s /var/run/postgresql

ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
ENV PGDATA /var/lib/postgresql/data
RUN mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA" && chmod 700 "$PGDATA"
VOLUME /var/lib/postgresql/data

COPY docker-entrypoint.sh /
Expand Down
9 changes: 5 additions & 4 deletions 9.3/alpine/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ fi

if [ "$1" = 'postgres' ]; then
mkdir -p "$PGDATA"
chmod 700 "$PGDATA"
chown -R postgres "$PGDATA"
chmod 700 "$PGDATA"

mkdir -p /var/run/postgresql
chown -R postgres /var/run/postgresql
chmod g+s /var/run/postgresql

mkdir -p /run/postgresql
chmod g+s /run/postgresql
chown -R postgres /run/postgresql

# look specifically for PG_VERSION, as it is expected in the DB dir
if [ ! -s "$PGDATA/PG_VERSION" ]; then
Expand Down
9 changes: 5 additions & 4 deletions 9.3/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ fi

if [ "$1" = 'postgres' ]; then
mkdir -p "$PGDATA"
chmod 700 "$PGDATA"
chown -R postgres "$PGDATA"
chmod 700 "$PGDATA"

mkdir -p /var/run/postgresql
chown -R postgres /var/run/postgresql
chmod g+s /var/run/postgresql

mkdir -p /run/postgresql
chmod g+s /run/postgresql
chown -R postgres /run/postgresql

# look specifically for PG_VERSION, as it is expected in the DB dir
if [ ! -s "$PGDATA/PG_VERSION" ]; then
Expand Down
3 changes: 2 additions & 1 deletion 9.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ RUN mv -v /usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample /usr/share/post
&& ln -sv ../postgresql.conf.sample /usr/share/postgresql/$PG_MAJOR/ \
&& sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/share/postgresql/postgresql.conf.sample

RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod g+s /var/run/postgresql

ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
ENV PGDATA /var/lib/postgresql/data
RUN mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA" && chmod 700 "$PGDATA"
VOLUME /var/lib/postgresql/data

COPY docker-entrypoint.sh /
Expand Down
8 changes: 7 additions & 1 deletion 9.4/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ RUN set -ex \
zlib-dev \
\
&& cd /usr/src/postgresql \
# update "DEFAULT_PGSOCKET_DIR" to "/var/run/postgresql" (matching Debian)
# see https://anonscm.debian.org/git/pkg-postgresql/postgresql.git/tree/debian/patches/51-default-sockets-in-var.patch?id=8b539fcb3e093a521c095e70bdfa76887217b89f
&& awk '$1 == "#define" && $2 == "DEFAULT_PGSOCKET_DIR" && $3 == "\"/tmp\"" { $3 = "\"/var/run/postgresql\""; print; next } { print }' src/include/pg_config_manual.h > src/include/pg_config_manual.h.new \
&& grep '/var/run/postgresql' src/include/pg_config_manual.h.new \
&& mv src/include/pg_config_manual.h.new src/include/pg_config_manual.h \
# configure options taken from:
# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5
&& ./configure \
Expand Down Expand Up @@ -113,10 +118,11 @@ RUN set -ex \
# make the sample config easier to munge (and "correct by default")
RUN sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample

RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod g+s /var/run/postgresql

ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
ENV PGDATA /var/lib/postgresql/data
RUN mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA" && chmod 700 "$PGDATA"
VOLUME /var/lib/postgresql/data

COPY docker-entrypoint.sh /
Expand Down
9 changes: 5 additions & 4 deletions 9.4/alpine/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ fi

if [ "$1" = 'postgres' ]; then
mkdir -p "$PGDATA"
chmod 700 "$PGDATA"
chown -R postgres "$PGDATA"
chmod 700 "$PGDATA"

mkdir -p /var/run/postgresql
chown -R postgres /var/run/postgresql
chmod g+s /var/run/postgresql

mkdir -p /run/postgresql
chmod g+s /run/postgresql
chown -R postgres /run/postgresql

# look specifically for PG_VERSION, as it is expected in the DB dir
if [ ! -s "$PGDATA/PG_VERSION" ]; then
Expand Down
9 changes: 5 additions & 4 deletions 9.4/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ fi

if [ "$1" = 'postgres' ]; then
mkdir -p "$PGDATA"
chmod 700 "$PGDATA"
chown -R postgres "$PGDATA"
chmod 700 "$PGDATA"

mkdir -p /var/run/postgresql
chown -R postgres /var/run/postgresql
chmod g+s /var/run/postgresql

mkdir -p /run/postgresql
chmod g+s /run/postgresql
chown -R postgres /run/postgresql

# look specifically for PG_VERSION, as it is expected in the DB dir
if [ ! -s "$PGDATA/PG_VERSION" ]; then
Expand Down
3 changes: 2 additions & 1 deletion 9.5/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ RUN mv -v /usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample /usr/share/post
&& ln -sv ../postgresql.conf.sample /usr/share/postgresql/$PG_MAJOR/ \
&& sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/share/postgresql/postgresql.conf.sample

RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod g+s /var/run/postgresql

ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
ENV PGDATA /var/lib/postgresql/data
RUN mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA" && chmod 700 "$PGDATA"
VOLUME /var/lib/postgresql/data

COPY docker-entrypoint.sh /
Expand Down
8 changes: 7 additions & 1 deletion 9.5/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ RUN set -ex \
zlib-dev \
\
&& cd /usr/src/postgresql \
# update "DEFAULT_PGSOCKET_DIR" to "/var/run/postgresql" (matching Debian)
# see https://anonscm.debian.org/git/pkg-postgresql/postgresql.git/tree/debian/patches/51-default-sockets-in-var.patch?id=8b539fcb3e093a521c095e70bdfa76887217b89f
&& awk '$1 == "#define" && $2 == "DEFAULT_PGSOCKET_DIR" && $3 == "\"/tmp\"" { $3 = "\"/var/run/postgresql\""; print; next } { print }' src/include/pg_config_manual.h > src/include/pg_config_manual.h.new \
&& grep '/var/run/postgresql' src/include/pg_config_manual.h.new \
&& mv src/include/pg_config_manual.h.new src/include/pg_config_manual.h \
# configure options taken from:
# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5
&& ./configure \
Expand Down Expand Up @@ -113,10 +118,11 @@ RUN set -ex \
# make the sample config easier to munge (and "correct by default")
RUN sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample

RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod g+s /var/run/postgresql

ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
ENV PGDATA /var/lib/postgresql/data
RUN mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA" && chmod 700 "$PGDATA"
VOLUME /var/lib/postgresql/data

COPY docker-entrypoint.sh /
Expand Down
9 changes: 5 additions & 4 deletions 9.5/alpine/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ fi

if [ "$1" = 'postgres' ]; then
mkdir -p "$PGDATA"
chmod 700 "$PGDATA"
chown -R postgres "$PGDATA"
chmod 700 "$PGDATA"

mkdir -p /var/run/postgresql
chown -R postgres /var/run/postgresql
chmod g+s /var/run/postgresql

mkdir -p /run/postgresql
chmod g+s /run/postgresql
chown -R postgres /run/postgresql

# look specifically for PG_VERSION, as it is expected in the DB dir
if [ ! -s "$PGDATA/PG_VERSION" ]; then
Expand Down
9 changes: 5 additions & 4 deletions 9.5/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ fi

if [ "$1" = 'postgres' ]; then
mkdir -p "$PGDATA"
chmod 700 "$PGDATA"
chown -R postgres "$PGDATA"
chmod 700 "$PGDATA"

mkdir -p /var/run/postgresql
chown -R postgres /var/run/postgresql
chmod g+s /var/run/postgresql

mkdir -p /run/postgresql
chmod g+s /run/postgresql
chown -R postgres /run/postgresql

# look specifically for PG_VERSION, as it is expected in the DB dir
if [ ! -s "$PGDATA/PG_VERSION" ]; then
Expand Down
3 changes: 2 additions & 1 deletion 9.6/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ RUN mv -v /usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample /usr/share/post
&& ln -sv ../postgresql.conf.sample /usr/share/postgresql/$PG_MAJOR/ \
&& sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/share/postgresql/postgresql.conf.sample

RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod g+s /var/run/postgresql

ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
ENV PGDATA /var/lib/postgresql/data
RUN mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA" && chmod 700 "$PGDATA"
VOLUME /var/lib/postgresql/data

COPY docker-entrypoint.sh /
Expand Down
8 changes: 7 additions & 1 deletion 9.6/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ RUN set -ex \
zlib-dev \
\
&& cd /usr/src/postgresql \
# update "DEFAULT_PGSOCKET_DIR" to "/var/run/postgresql" (matching Debian)
# see https://anonscm.debian.org/git/pkg-postgresql/postgresql.git/tree/debian/patches/51-default-sockets-in-var.patch?id=8b539fcb3e093a521c095e70bdfa76887217b89f
&& awk '$1 == "#define" && $2 == "DEFAULT_PGSOCKET_DIR" && $3 == "\"/tmp\"" { $3 = "\"/var/run/postgresql\""; print; next } { print }' src/include/pg_config_manual.h > src/include/pg_config_manual.h.new \
&& grep '/var/run/postgresql' src/include/pg_config_manual.h.new \
&& mv src/include/pg_config_manual.h.new src/include/pg_config_manual.h \
# configure options taken from:
# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5
&& ./configure \
Expand Down Expand Up @@ -113,10 +118,11 @@ RUN set -ex \
# make the sample config easier to munge (and "correct by default")
RUN sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample

RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod g+s /var/run/postgresql

ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
ENV PGDATA /var/lib/postgresql/data
RUN mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA" && chmod 700 "$PGDATA"
VOLUME /var/lib/postgresql/data

COPY docker-entrypoint.sh /
Expand Down
9 changes: 5 additions & 4 deletions 9.6/alpine/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ fi

if [ "$1" = 'postgres' ]; then
mkdir -p "$PGDATA"
chmod 700 "$PGDATA"
chown -R postgres "$PGDATA"
chmod 700 "$PGDATA"

mkdir -p /var/run/postgresql
chown -R postgres /var/run/postgresql
chmod g+s /var/run/postgresql

mkdir -p /run/postgresql
chmod g+s /run/postgresql
chown -R postgres /run/postgresql

# look specifically for PG_VERSION, as it is expected in the DB dir
if [ ! -s "$PGDATA/PG_VERSION" ]; then
Expand Down
9 changes: 5 additions & 4 deletions 9.6/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ fi

if [ "$1" = 'postgres' ]; then
mkdir -p "$PGDATA"
chmod 700 "$PGDATA"
chown -R postgres "$PGDATA"
chmod 700 "$PGDATA"

mkdir -p /var/run/postgresql
chown -R postgres /var/run/postgresql
chmod g+s /var/run/postgresql

mkdir -p /run/postgresql
chmod g+s /run/postgresql
chown -R postgres /run/postgresql

# look specifically for PG_VERSION, as it is expected in the DB dir
if [ ! -s "$PGDATA/PG_VERSION" ]; then
Expand Down
8 changes: 7 additions & 1 deletion Dockerfile-alpine.template
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ RUN set -ex \
zlib-dev \
\
&& cd /usr/src/postgresql \
# update "DEFAULT_PGSOCKET_DIR" to "/var/run/postgresql" (matching Debian)
# see https://anonscm.debian.org/git/pkg-postgresql/postgresql.git/tree/debian/patches/51-default-sockets-in-var.patch?id=8b539fcb3e093a521c095e70bdfa76887217b89f
&& awk '$1 == "#define" && $2 == "DEFAULT_PGSOCKET_DIR" && $3 == "\"/tmp\"" { $3 = "\"/var/run/postgresql\""; print; next } { print }' src/include/pg_config_manual.h > src/include/pg_config_manual.h.new \
&& grep '/var/run/postgresql' src/include/pg_config_manual.h.new \
&& mv src/include/pg_config_manual.h.new src/include/pg_config_manual.h \
# configure options taken from:
# https://anonscm.debian.org/cgit/pkg-postgresql/postgresql.git/tree/debian/rules?h=9.5
&& ./configure \
Expand Down Expand Up @@ -113,10 +118,11 @@ RUN set -ex \
# make the sample config easier to munge (and "correct by default")
RUN sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample

RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
RUN mkdir -p /var/run/postgresql && chown -R postgres:postgres /var/run/postgresql && chmod g+s /var/run/postgresql

ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH
ENV PGDATA /var/lib/postgresql/data
RUN mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA" && chmod 700 "$PGDATA"
VOLUME /var/lib/postgresql/data

COPY docker-entrypoint.sh /
Expand Down
Loading

0 comments on commit b68154e

Please sign in to comment.