Skip to content

Commit bea821e

Browse files
jmckulkjkatz
authored andcommitted
Update to how CentOS containers utilize the upstream PostgreSQL repositories.
The upstream PostgreSQL repositories (PGDG) updated how RPMs and their dependencies are ingested, which caused some of our previous configured way of download the RPMS to fail. This commit adjusts the way the RPMs are downloaded. Instead of disabling the repositories we do not need, we disable _all_ the repositories and only enable the one we need. The yum calls were updated in the pgo-backrest dockerfile to have better readability and stability. This dockerfile will now fail if any packages do not exist. Previously this was accomplished by running separate yum commands for each but is now done with in one command by using the setopt flag. For example, for the PostgreSQL 11 RPMs, we would disable _all_ of the repositories (`pgdg*`) and only enable the one with the PostgreSQL 11 RPMs (`pgdg11`)
1 parent 58bb1dc commit bea821e

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

centos7/Dockerfile.pgo-backrest-repo.centos7

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LABEL Vendor="Crunchy Data Solutions" \
88
summary="Crunchy Data PostgreSQL Operator - Apiserver" \
99
description="Crunchy Data PostgreSQL Operator - Apiserver"
1010

11-
ENV PGVERSION="11" PGDG_REPO="pgdg-redhat-repo-latest.noarch.rpm" PGDG_REPO_DISABLE="pgdg10,pgdg96,pgdg95,pgdg94" \
11+
ENV PGVERSION="11" PGDG_REPO="pgdg-redhat-repo-latest.noarch.rpm" PGDG_REPO_DISABLE="pgdg*" PGDG_REPO_ENABLE="pgdg11"\
1212
BACKREST_VERSION="2.17"
1313

1414
COPY redhat/licenses /licenses
@@ -19,7 +19,7 @@ RUN rpm -Uvh https://download.postgresql.org/pub/repos/yum/${PGVERSION}/redhat/r
1919

2020
RUN yum -y update && \
2121
#yum -y install epel-release && \
22-
yum -y install --disablerepo="${PGDG_REPO_DISABLE}" \
22+
yum -y install --disablerepo="${PGDG_REPO_DISABLE}" --enablerepo="${PGDG_REPO_ENABLE}" \
2323
psmisc openssh-server openssh-clients pgbackrest-"${BACKREST_VERSION}" hostname procps-ng && \
2424
yum -y clean all
2525

centos7/Dockerfile.pgo-backrest-restore.centos7

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ LABEL Vendor="Crunchy Data Solutions" \
88
summary="Crunchy Data PostgreSQL Operator - pgBackRest" \
99
description="pgBackRest image that is integrated for use with Crunchy Data's PostgreSQL Operator."
1010

11-
ENV PGVERSION="11" PGDG_REPO="pgdg-redhat-repo-latest.noarch.rpm" PGDG_REPO_DISABLE="pgdg10,pgdg96,pgdg95,pgdg94" \
11+
ENV PGVERSION="11" PGDG_REPO="pgdg-redhat-repo-latest.noarch.rpm" PGDG_REPO_DISABLE="pgdg*" PGDG_REPO_ENABLE="pgdg11" \
1212
BACKREST_VERSION="2.17"
1313

1414
COPY redhat/licenses /licenses
1515
COPY licenses /licenses
1616

1717
RUN rpm -Uvh https://download.postgresql.org/pub/repos/yum/${PGVERSION}/redhat/rhel-7-x86_64/${PGDG_REPO}
1818

19-
RUN yum -y update && yum -y install --disablerepo="${PGDG_REPO_DISABLE}" \
19+
RUN yum -y update && yum -y install --disablerepo="${PGDG_REPO_DISABLE}" --enablerepo="${PGDG_REPO_ENABLE}" \
2020
psmisc openssh-server openssh-clients pgbackrest-"${BACKREST_VERSION}" postgresql11-server procps-ng && yum -y clean all
2121

2222
RUN mkdir -p /opt/cpm/bin /pgdata && chown -R 26:26 /opt/cpm

centos7/Dockerfile.pgo-backrest.centos7

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,22 @@ LABEL Vendor="Crunchy Data Solutions" \
88
summary="Crunchy Data PostgreSQL Operator - pgBackRest" \
99
description="pgBackRest image that is integrated for use with Crunchy Data's PostgreSQL Operator."
1010

11-
ENV PGVERSION="11" PGDG_REPO="pgdg-redhat-repo-latest.noarch.rpm" PGDG_REPO_DISABLE="pgdg10,pgdg96,pgdg95,pgdg94" \
11+
ENV PGVERSION="11" PGDG_REPO="pgdg-redhat-repo-latest.noarch.rpm" PGDG_REPO_DISABLE="pgdg*" PGDG_REPO_ENABLE="pgdg11" \
1212
BACKREST_VERSION="2.17"
1313

1414
COPY redhat/licenses /licenses
1515
COPY licenses /licenses
1616

1717
RUN rpm -Uvh https://download.postgresql.org/pub/repos/yum/${PGVERSION}/redhat/rhel-7-x86_64/${PGDG_REPO}
1818

19-
RUN yum -y update && yum -y install --disablerepo="${PGDG_REPO_DISABLE}" \
20-
postgresql11-server && yum -y install pgbackrest-"${BACKREST_VERSION}" && yum -y clean all
19+
RUN yum -y update && \
20+
yum -y install \
21+
--disablerepo="${PGDG_REPO_DISABLE}" \
22+
--enablerepo="${PGDG_REPO_ENABLE}" \
23+
--setopt=skip_missing_names_on_install=False \
24+
postgresql11-server \
25+
pgbackrest-"${BACKREST_VERSION}" \
26+
&& yum -y clean all
2127

2228
RUN mkdir -p /opt/cpm/bin /pgdata /backrestrepo && chown -R 26:26 /opt/cpm
2329
ADD bin/pgo-backrest/ /opt/cpm/bin

0 commit comments

Comments
 (0)