1+ FROM ubuntu:bionic-20180526 AS add-apt-repositories
2+
3+ RUN apt-get update \
4+ && DEBIAN_FRONTEND=noninteractive apt-get install -y wget gnupg \
5+ && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
6+ && echo 'deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main' >> /etc/apt/sources.list
7+
18FROM ubuntu:bionic-20180526
9+
210LABEL maintainer=
"[email protected] " 311
412ENV PG_APP_HOME="/etc/docker-postgresql" \
@@ -12,11 +20,11 @@ ENV PG_APP_HOME="/etc/docker-postgresql" \
1220ENV PG_BINDIR=/usr/lib/postgresql/${PG_VERSION}/bin \
1321 PG_DATADIR=${PG_HOME}/${PG_VERSION}/main
1422
23+ COPY --from=add-apt-repositories /etc/apt/trusted.gpg /etc/apt/trusted.gpg
24+
25+ COPY --from=add-apt-repositories /etc/apt/sources.list /etc/apt/sources.list
26+
1527RUN apt-get update \
16- && DEBIAN_FRONTEND=noninteractive apt-get install -y wget gnupg \
17- && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
18- && echo 'deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main' > /etc/apt/sources.list.d/pgdg.list \
19- && apt-get update \
2028 && DEBIAN_FRONTEND=noninteractive apt-get install -y acl sudo \
2129 postgresql-${PG_VERSION} postgresql-client-${PG_VERSION} postgresql-contrib-${PG_VERSION} \
2230 && ln -sf ${PG_DATADIR}/postgresql.conf /etc/postgresql/${PG_VERSION}/main/postgresql.conf \
@@ -26,9 +34,13 @@ RUN apt-get update \
2634 && rm -rf /var/lib/apt/lists/*
2735
2836COPY runtime/ ${PG_APP_HOME}/
37+
2938COPY entrypoint.sh /sbin/entrypoint.sh
39+
3040RUN chmod 755 /sbin/entrypoint.sh
3141
3242EXPOSE 5432/tcp
43+
3344WORKDIR ${PG_HOME}
45+
3446ENTRYPOINT ["/sbin/entrypoint.sh" ]
0 commit comments