Skip to content

Commit 1eab155

Browse files
committed
Now setting ACLs for resolv.conf
1 parent 490f33c commit 1eab155

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
@@ -342,3 +342,8 @@ create_replication_user() {
342342
esac
343343
fi
344344
}
345+
346+
set_resolvconf_perms() {
347+
echo "Setting resolv ACLs..."
348+
setfacl -m user:${PG_USER}:r /etc/resolv.conf
349+
}

0 commit comments

Comments
 (0)