Skip to content

Commit 10d5447

Browse files
committed
Import pg repo key
1 parent ca3382f commit 10d5447

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

image/db/rhel/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ COPY --from=extracted_bundle /bundle/etc/postgresql.conf /bundle/etc/pg_hba.conf
2525

2626
ARG POSTGRESQL_ARCH=x86_64
2727

28-
RUN curl -sSLf https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-${POSTGRESQL_ARCH}/pgdg-redhat-repo-latest.noarch.rpm -o /tmp/pg_repo.rpm && \
28+
RUN curl -sSLf https://download.postgresql.org/pub/repos/yum/RPM-GPG-KEY-PGDG-${PG_MAJOR} -o /tmp/pg_repo.key && \
29+
rpm --import /tmp/pg_repo.key && \
30+
curl -sSLf https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-${POSTGRESQL_ARCH}/pgdg-redhat-repo-latest.noarch.rpm -o /tmp/pg_repo.rpm && \
2931
rpm -i /tmp/pg_repo.rpm && \
3032
# Skip repo check for ARM as it's used only for development purposes and package has wrong signature.
3133
if [[ "$POSTGRESQL_ARCH" == "aarch64" ]]; then sed -i 's/repo_gpgcheck = 1/repo_gpgcheck = 0/g' /etc/yum.repos.d/pgdg-redhat-all.repo; fi && \
@@ -46,7 +48,7 @@ RUN curl -sSLf https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-${POS
4648
rpm -e --nodeps $(rpm -qa 'pgdg-redhat-repo*') && \
4749
# (Optional) Remove line below to keep package management utilities
4850
rpm -e --nodeps $(rpm -qa shadow-utils curl '*rpm*' '*dnf*' '*libsolv*' '*hawkey*' 'yum*') && \
49-
rm -rf /var/cache/dnf /var/cache/yum /tmp/pg_repo.rpm && \
51+
rm -rf /var/cache/dnf /var/cache/yum /tmp/pg_repo.rpm /tmp/pg_repo.key && \
5052
localedef -f UTF-8 -i en_US en_US.UTF-8 && \
5153
chown postgres:postgres /usr/local/bin/docker-entrypoint.sh && \
5254
chmod +x /usr/local/bin/docker-entrypoint.sh && \

image/db/rhel/Dockerfile.slim

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ COPY --from=extracted_bundle /bundle/etc/postgresql.conf /bundle/etc/pg_hba.conf
2525

2626
ARG POSTGRESQL_ARCH=x86_64
2727

28-
RUN curl -sSLf https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-${POSTGRESQL_ARCH}/pgdg-redhat-repo-latest.noarch.rpm -o /tmp/pg_repo.rpm && \
28+
RUN curl -sSLf https://download.postgresql.org/pub/repos/yum/RPM-GPG-KEY-PGDG-${PG_MAJOR} -o /tmp/pg_repo.key && \
29+
rpm --import /tmp/pg_repo.key && \
30+
curl -sSLf https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-${POSTGRESQL_ARCH}/pgdg-redhat-repo-latest.noarch.rpm -o /tmp/pg_repo.rpm && \
2931
rpm -i /tmp/pg_repo.rpm && \
3032
# Skip repo check for ARM as it's used only for development purposes and package has wrong signature.
3133
if [[ "$POSTGRESQL_ARCH" == "aarch64" ]]; then sed -i 's/repo_gpgcheck = 1/repo_gpgcheck = 0/g' /etc/yum.repos.d/pgdg-redhat-all.repo; fi && \
@@ -46,7 +48,7 @@ RUN curl -sSLf https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-${POS
4648
rpm -e --nodeps $(rpm -qa 'pgdg-redhat-repo*') && \
4749
# (Optional) Remove line below to keep package management utilities
4850
rpm -e --nodeps $(rpm -qa shadow-utils curl '*rpm*' '*dnf*' '*libsolv*' '*hawkey*' 'yum*') && \
49-
rm -rf /var/cache/dnf /var/cache/yum /tmp/pg_repo.rpm && \
51+
rm -rf /var/cache/dnf /var/cache/yum /tmp/pg_repo.rpm /tmp/pg_repo.key && \
5052
localedef -f UTF-8 -i en_US en_US.UTF-8 && \
5153
chown postgres:postgres /usr/local/bin/docker-entrypoint.sh && \
5254
chmod +x /usr/local/bin/docker-entrypoint.sh && \

0 commit comments

Comments
 (0)