Skip to content

Commit 27bcffb

Browse files
committed
Reorder steps for Ubuntu 20.04 to allow HTTPS usage
1 parent 6898bc3 commit 27bcffb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ubuntu20.04/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ ENV POSTGRESQL_VER=${POSTGRESQL_VER}
3434
ARG POSTGRESQL_TESTING=0
3535
ENV POSTGRESQL_TESTING=${POSTGRESQL_TESTING}
3636

37-
# Add PostgreSQL's repository
38-
RUN [ ${POSTGRESQL_TESTING} -eq 1 ] && TESTING="-testing"; echo "deb https://download.postgresql.org/pub/repos/apt/ focal-pgdg${testing} ${POSTGRESQL_VER} main" >> /etc/apt/sources.list.d/pgdg.list
39-
4037
# Pass the output of date command as DATE argument if you want
4138
# make sure that the image is generated using the lastest
4239
# PostgreSQL packages (cache will be used for previous steps)
@@ -45,10 +42,13 @@ ARG DATE=None
4542
# Add the PostgreSQL PGP key to verify their Debian packages and install them
4643
# Key should be the same as https://www.postgresql.org/media/keys/ACCC4CF8.asc
4744
# Then generate a list of original packages, upgrade and install PostgreSQL
48-
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 && \
49-
dpkg --get-selections | grep 'install' | grep -v 'deinstall'|cut -f1 > /opt/packages-image.txt && \
45+
RUN dpkg --get-selections | grep 'install' | grep -v 'deinstall'|cut -f1 > /opt/packages-image.txt && \
46+
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 && \
5047
apt-get -qq -o=Dpkg::Use-Pty=0 update > /dev/null && \
48+
LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive apt-get -qq -o=Dpkg::Use-Pty=0 -y install ca-certificates && \
5149
LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive apt-get -qq -o=Dpkg::Use-Pty=0 -y dist-upgrade > /dev/null && \
50+
[ ${POSTGRESQL_TESTING} -eq 1 ] && TESTING="-testing"; echo "deb https://download.postgresql.org/pub/repos/apt/ focal-pgdg${testing} ${POSTGRESQL_VER} main" >> /etc/apt/sources.list.d/pgdg.list && \
51+
apt-get -qq -o=Dpkg::Use-Pty=0 update > /dev/null && \
5252
LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 DEBIAN_FRONTEND=noninteractive apt-get -qq -o=Dpkg::Use-Pty=0 -y install \
5353
postgresql-${POSTGRESQL_VER} \
5454
postgresql-client-${POSTGRESQL_VER} \

0 commit comments

Comments
 (0)