Skip to content

Commit 7190b5b

Browse files
author
Sameer Naik
committed
Merge branch 'patch-1-resolvacl' of https://github.com/utrack/docker-postgresql into utrack-patch-1-resolvacl
2 parents 197d53e + 1eab155 commit 7190b5b

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ENV PG_BINDIR=/usr/lib/postgresql/${PG_VERSION}/bin \
1515
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
1616
&& echo 'deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main' > /etc/apt/sources.list.d/pgdg.list \
1717
&& apt-get update \
18-
&& DEBIAN_FRONTEND=noninteractive apt-get install -y postgresql-${PG_VERSION} postgresql-client-${PG_VERSION} postgresql-contrib-${PG_VERSION} \
18+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y postgresql-${PG_VERSION} postgresql-client-${PG_VERSION} postgresql-contrib-${PG_VERSION} acl \
1919
&& ln -sf ${PG_DATADIR}/postgresql.conf /etc/postgresql/${PG_VERSION}/main/postgresql.conf \
2020
&& ln -sf ${PG_DATADIR}/pg_hba.conf /etc/postgresql/${PG_VERSION}/main/pg_hba.conf \
2121
&& ln -sf ${PG_DATADIR}/pg_ident.conf /etc/postgresql/${PG_VERSION}/main/pg_ident.conf \

entrypoint.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ if [[ -z ${1} ]]; then
3131
create_database
3232
create_replication_user
3333

34+
set_resolvconf_perms
35+
3436
echo "Starting PostgreSQL ${PG_VERSION}..."
3537
exec start-stop-daemon --start --chuid ${PG_USER}:${PG_USER} \
3638
--exec ${PG_BINDIR}/postgres -- -D ${PG_DATADIR} ${EXTRA_ARGS}

runtime/functions

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,3 +346,8 @@ create_replication_user() {
346346
esac
347347
fi
348348
}
349+
350+
set_resolvconf_perms() {
351+
echo "Setting resolv ACLs..."
352+
setfacl -m user:${PG_USER}:r /etc/resolv.conf
353+
}

0 commit comments

Comments
 (0)