Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PKG-279]: Using ubi9-minimal as base image for PG docker images. #1100

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 22 additions & 11 deletions percona-distribution-postgresql-12/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
FROM redhat/ubi8-minimal
FROM oraclelinux:9 AS downloader

RUN yum install -y epel-release; \
yum config-manager --set-enabled ol9_codeready_builder; \
yum install -y --downloadonly perl-JSON; \
mkdir -p downloaded-packages; \
cp -rp /var/cache/dnf/ol9_appstream-*/packages/*.rpm downloaded-packages; \
tar -cvzf downloaded-packages.tar.gz downloaded-packages

FROM redhat/ubi9-minimal

LABEL org.opencontainers.image.authors="[email protected]"

RUN microdnf -y update; \
microdnf -y install glibc-langpack-en

ENV PPG_VERSION 12.20-1
ENV PPG_VERSION 12.22-1
ENV PPG_MAJOR_VERSION 12
ENV PPG_MINOR_VERSION 20
ENV OS_VER el8
ENV PPG_MINOR_VERSION 22
ENV OS_VER el9
ENV FULL_PERCONA_VERSION "${PPG_VERSION}.${OS_VER}"
ENV PPG_REPO testing
ENV PPG_REPO_VERSION "${PPG_MAJOR_VERSION}.${PPG_MINOR_VERSION}"
Expand All @@ -33,7 +42,6 @@ RUN set -ex; \
rpm -i /tmp/percona-release.rpm; \
rm -rf "$GNUPGHOME" /tmp/percona-release.rpm; \
rpm --import /etc/pki/rpm-gpg/PERCONA-PACKAGING-KEY; \
#percona-release setup -y ppg${PPG_MAJOR_VERSION}; \
percona-release enable telemetry ${PPG_REPO}; \
percona-release enable ppg-${PPG_REPO_VERSION} ${PPG_REPO};

Expand All @@ -59,14 +67,17 @@ RUN set -ex; \
RUN useradd -u 1001 -r -g 0 -s /sbin/nologin \
-c "Default Application User" postgres

RUN set -ex; \
export GNUPGHOME="$(mktemp -d)"; \
curl -Lf -o /tmp/perl-JSON.rpm http://vault.centos.org/centos/8/AppStream/x86_64/os/Packages/perl-JSON-2.97.001-2.el8.noarch.rpm; \
rpmkeys --checksig /tmp/perl-JSON.rpm; \
rpm -i /tmp/perl-JSON.rpm

ENV PGDATA /data/db

COPY --from=downloader /downloaded-packages.tar.gz .
RUN tar -xvzf downloaded-packages.tar.gz; \
cd downloaded-packages; \
rpm -ivh perl-*.rpm; \
rpm -ivh perl-JSON*.rpm; \
rm -f /downloaded-packages.tar.gz; \
cd -; \
rm -rf /downloaded-packages /var/cache/dnf /var/cache/yum

RUN set -ex; \
microdnf install -y \
percona-postgresql${PPG_MAJOR_VERSION}-server-${FULL_PERCONA_VERSION} \
Expand Down
51 changes: 34 additions & 17 deletions percona-distribution-postgresql-12/Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
FROM oraclelinux:9
FROM oraclelinux:9 AS downloader

RUN yum install -y epel-release; \
yum config-manager --set-enabled ol9_codeready_builder; \
yum install -y --downloadonly perl-JSON; \
mkdir -p downloaded-packages; \
cp -rp /var/cache/dnf/ol9_appstream-*/packages/*.rpm downloaded-packages; \
tar -cvzf downloaded-packages.tar.gz downloaded-packages

FROM redhat/ubi9-minimal

LABEL org.opencontainers.image.authors="[email protected]"

RUN dnf -y update; \
dnf -y install glibc-langpack-en
RUN microdnf -y update; \
microdnf -y install glibc-langpack-en

ENV PPG_VERSION 12.19-1
ENV PPG_VERSION 12.22-1
ENV PPG_MAJOR_VERSION 12
ENV PPG_MINOR_VERSION 19
ENV PPG_MINOR_VERSION 22
ENV OS_VER el9
ENV FULL_PERCONA_VERSION "${PPG_VERSION}.${OS_VER}"
ENV PPG_REPO testing
Expand All @@ -27,21 +36,18 @@ RUN set -ex; \
gpg --batch --export --armor 4D1BB29D63D98E422B2113B19334A25F8507EFA5 > ${GNUPGHOME}/PERCONA-PACKAGING-KEY; \
gpg --batch --export --armor 99DB70FAE1D7CE227FB6488205B555B38483C65D > ${GNUPGHOME}/RPM-GPG-KEY-centosofficial; \
rpmkeys --import ${GNUPGHOME}/PERCONA-PACKAGING-KEY ${GNUPGHOME}/RPM-GPG-KEY-centosofficial; \
dnf install -y findutils; \
microdnf install -y findutils; \
curl -Lf -o /tmp/percona-release.rpm https://repo.percona.com/yum/percona-release-latest.noarch.rpm; \
rpmkeys --checksig /tmp/percona-release.rpm; \
rpm -i /tmp/percona-release.rpm; \
rm -rf "$GNUPGHOME" /tmp/percona-release.rpm; \
rpm --import /etc/pki/rpm-gpg/PERCONA-PACKAGING-KEY; \
curl -Lf -o /tmp/percona-release https://raw.githubusercontent.com/percona/percona-repositories/release-1.0-28/scripts/percona-release.sh; \
mv /tmp/percona-release /usr/bin/; \
chmod +x /usr/bin/percona-release; \
percona-release enable telemetry ${PPG_REPO}; \
percona-release enable ppg-${PPG_REPO_VERSION} ${PPG_REPO};

RUN set -ex; \
dnf -y update; \
dnf -y install \
microdnf -y update; \
microdnf -y install \
bind-utils \
gettext \
hostname \
Expand All @@ -50,19 +56,30 @@ RUN set -ex; \
bzip2 \
lz4 \
procps-ng; \
dnf -y install \
microdnf -y install \
nss_wrapper \
shadow-utils \
libpq \
libedit; \
dnf clean all
microdnf clean all

# the numeric UID is needed for OpenShift
RUN useradd -u 1001 -r -g 0 -s /sbin/nologin \
-c "Default Application User" postgres

ENV PGDATA /data/db

COPY --from=downloader /downloaded-packages.tar.gz .
RUN tar -xvzf downloaded-packages.tar.gz; \
cd downloaded-packages; \
rpm -ivh perl-*.rpm; \
rpm -ivh perl-JSON*.rpm; \
rm -f /downloaded-packages.tar.gz; \
cd -; \
rm -rf /downloaded-packages /var/cache/dnf /var/cache/yum

RUN set -ex; \
dnf install -y \
microdnf install -y \
percona-postgresql${PPG_MAJOR_VERSION}-server-${FULL_PERCONA_VERSION} \
percona-postgresql${PPG_MAJOR_VERSION}-contrib-${FULL_PERCONA_VERSION} \
percona-postgresql-common \
Expand All @@ -71,9 +88,9 @@ RUN set -ex; \
percona-pgaudit${PPG_MAJOR_VERSION} \
percona-pgaudit${PPG_MAJOR_VERSION}_set_user \
percona-wal2json${PPG_MAJOR_VERSION}; \
dnf clean all; \
rm -rf /var/cache/dnf /var/cache/yum /data/db && mkdir -p /data/db /docker-entrypoint-initdb.d; \
chown -R 1001:0 /data/db docker-entrypoint-initdb.d
microdnf clean all; \
rm -rf /var/cache/dnf /var/cache/yum $PGDATA && mkdir -p $PGDATA /docker-entrypoint-initdb.d; \
chown -R 1001:0 $PGDATA docker-entrypoint-initdb.d

RUN set -ex; \
sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/pgsql-${PPG_MAJOR_VERSION}/share/postgresql.conf.sample; \
Expand Down
33 changes: 22 additions & 11 deletions percona-distribution-postgresql-13/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
FROM redhat/ubi8-minimal
FROM oraclelinux:9 AS downloader

RUN yum install -y epel-release; \
yum config-manager --set-enabled ol9_codeready_builder; \
yum install -y --downloadonly perl-JSON; \
mkdir -p downloaded-packages; \
cp -rp /var/cache/dnf/ol9_appstream-*/packages/*.rpm downloaded-packages; \
tar -cvzf downloaded-packages.tar.gz downloaded-packages

FROM redhat/ubi9-minimal

LABEL org.opencontainers.image.authors="[email protected]"

RUN microdnf -y update; \
microdnf -y install glibc-langpack-en

ENV PPG_VERSION 13.16-1
ENV PPG_VERSION 13.18-1
ENV PPG_MAJOR_VERSION 13
ENV PPG_MINOR_VERSION 16
ENV OS_VER el8
ENV PPG_MINOR_VERSION 18
ENV OS_VER el9
ENV FULL_PERCONA_VERSION "${PPG_VERSION}.${OS_VER}"
ENV PPG_REPO testing
ENV PPG_REPO_VERSION "${PPG_MAJOR_VERSION}.${PPG_MINOR_VERSION}"
Expand All @@ -33,7 +42,6 @@ RUN set -ex; \
rpm -i /tmp/percona-release.rpm; \
rm -rf "$GNUPGHOME" /tmp/percona-release.rpm; \
rpm --import /etc/pki/rpm-gpg/PERCONA-PACKAGING-KEY; \
#percona-release setup -y ppg${PPG_MAJOR_VERSION}; \
percona-release enable telemetry ${PPG_REPO}; \
percona-release enable ppg-${PPG_REPO_VERSION} ${PPG_REPO};

Expand All @@ -59,14 +67,17 @@ RUN set -ex; \
RUN useradd -u 1001 -r -g 0 -s /sbin/nologin \
-c "Default Application User" postgres

RUN set -ex; \
export GNUPGHOME="$(mktemp -d)"; \
curl -Lf -o /tmp/perl-JSON.rpm http://vault.centos.org/centos/8/AppStream/x86_64/os/Packages/perl-JSON-2.97.001-2.el8.noarch.rpm; \
rpmkeys --checksig /tmp/perl-JSON.rpm; \
rpm -i /tmp/perl-JSON.rpm

ENV PGDATA /data/db

COPY --from=downloader /downloaded-packages.tar.gz .
RUN tar -xvzf downloaded-packages.tar.gz; \
cd downloaded-packages; \
rpm -ivh perl-*.rpm; \
rpm -ivh perl-JSON*.rpm; \
rm -f /downloaded-packages.tar.gz; \
cd -; \
rm -rf /downloaded-packages /var/cache/dnf /var/cache/yum

RUN set -ex; \
microdnf install -y \
percona-postgresql${PPG_MAJOR_VERSION}-server-${FULL_PERCONA_VERSION} \
Expand Down
51 changes: 34 additions & 17 deletions percona-distribution-postgresql-13/Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
FROM oraclelinux:9
FROM oraclelinux:9 AS downloader

RUN yum install -y epel-release; \
yum config-manager --set-enabled ol9_codeready_builder; \
yum install -y --downloadonly perl-JSON; \
mkdir -p downloaded-packages; \
cp -rp /var/cache/dnf/ol9_appstream-*/packages/*.rpm downloaded-packages; \
tar -cvzf downloaded-packages.tar.gz downloaded-packages

FROM redhat/ubi9-minimal

LABEL org.opencontainers.image.authors="[email protected]"

RUN dnf -y update; \
dnf -y install glibc-langpack-en
RUN microdnf -y update; \
microdnf -y install glibc-langpack-en

ENV PPG_VERSION 13.16-1
ENV PPG_VERSION 13.18-1
ENV PPG_MAJOR_VERSION 13
ENV PPG_MINOR_VERSION 16
ENV PPG_MINOR_VERSION 18
ENV OS_VER el9
ENV FULL_PERCONA_VERSION "${PPG_VERSION}.${OS_VER}"
ENV PPG_REPO testing
Expand All @@ -27,21 +36,18 @@ RUN set -ex; \
gpg --batch --export --armor 4D1BB29D63D98E422B2113B19334A25F8507EFA5 > ${GNUPGHOME}/PERCONA-PACKAGING-KEY; \
gpg --batch --export --armor 99DB70FAE1D7CE227FB6488205B555B38483C65D > ${GNUPGHOME}/RPM-GPG-KEY-centosofficial; \
rpmkeys --import ${GNUPGHOME}/PERCONA-PACKAGING-KEY ${GNUPGHOME}/RPM-GPG-KEY-centosofficial; \
dnf install -y findutils; \
microdnf install -y findutils; \
curl -Lf -o /tmp/percona-release.rpm https://repo.percona.com/yum/percona-release-latest.noarch.rpm; \
rpmkeys --checksig /tmp/percona-release.rpm; \
rpm -i /tmp/percona-release.rpm; \
rm -rf "$GNUPGHOME" /tmp/percona-release.rpm; \
rpm --import /etc/pki/rpm-gpg/PERCONA-PACKAGING-KEY; \
curl -Lf -o /tmp/percona-release https://raw.githubusercontent.com/percona/percona-repositories/release-1.0-28/scripts/percona-release.sh; \
mv /tmp/percona-release /usr/bin/; \
chmod +x /usr/bin/percona-release; \
percona-release enable telemetry ${PPG_REPO}; \
percona-release enable ppg-${PPG_REPO_VERSION} ${PPG_REPO};

RUN set -ex; \
dnf -y update; \
dnf -y install \
microdnf -y update; \
microdnf -y install \
bind-utils \
gettext \
hostname \
Expand All @@ -50,19 +56,30 @@ RUN set -ex; \
bzip2 \
lz4 \
procps-ng; \
dnf -y install \
microdnf -y install \
nss_wrapper \
shadow-utils \
libpq \
libedit; \
dnf clean all
microdnf clean all

# the numeric UID is needed for OpenShift
RUN useradd -u 1001 -r -g 0 -s /sbin/nologin \
-c "Default Application User" postgres

ENV PGDATA /data/db

COPY --from=downloader /downloaded-packages.tar.gz .
RUN tar -xvzf downloaded-packages.tar.gz; \
cd downloaded-packages; \
rpm -ivh perl-*.rpm; \
rpm -ivh perl-JSON*.rpm; \
rm -f /downloaded-packages.tar.gz; \
cd -; \
rm -rf /downloaded-packages /var/cache/dnf /var/cache/yum

RUN set -ex; \
dnf install -y \
microdnf install -y \
percona-postgresql${PPG_MAJOR_VERSION}-server-${FULL_PERCONA_VERSION} \
percona-postgresql${PPG_MAJOR_VERSION}-contrib-${FULL_PERCONA_VERSION} \
percona-postgresql-common \
Expand All @@ -72,9 +89,9 @@ RUN set -ex; \
percona-pgaudit${PPG_MAJOR_VERSION}_set_user \
percona-pgvector_${PPG_MAJOR_VERSION} \
percona-wal2json${PPG_MAJOR_VERSION}; \
dnf clean all; \
rm -rf /var/cache/dnf /var/cache/yum /data/db && mkdir -p /data/db /docker-entrypoint-initdb.d; \
chown -R 1001:0 /data/db docker-entrypoint-initdb.d
microdnf clean all; \
rm -rf /var/cache/dnf /var/cache/yum $PGDATA && mkdir -p $PGDATA /docker-entrypoint-initdb.d; \
chown -R 1001:0 $PGDATA docker-entrypoint-initdb.d

RUN set -ex; \
sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/pgsql-${PPG_MAJOR_VERSION}/share/postgresql.conf.sample; \
Expand Down
33 changes: 22 additions & 11 deletions percona-distribution-postgresql-14/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
FROM redhat/ubi8-minimal
FROM oraclelinux:9 AS downloader

RUN yum install -y epel-release; \
yum config-manager --set-enabled ol9_codeready_builder; \
yum install -y --downloadonly perl-JSON; \
mkdir -p downloaded-packages; \
cp -rp /var/cache/dnf/ol9_appstream-*/packages/*.rpm downloaded-packages; \
tar -cvzf downloaded-packages.tar.gz downloaded-packages

FROM redhat/ubi9-minimal

LABEL org.opencontainers.image.authors="[email protected]"

RUN microdnf -y update; \
microdnf -y install glibc-langpack-en

ENV PPG_VERSION 14.13-1
ENV PPG_VERSION 14.15-1
ENV PPG_MAJOR_VERSION 14
ENV PPG_MINOR_VERSION 13
ENV OS_VER el8
ENV PPG_MINOR_VERSION 15
ENV OS_VER el9
ENV FULL_PERCONA_VERSION "${PPG_VERSION}.${OS_VER}"
ENV PPG_REPO testing
ENV PPG_REPO_VERSION "${PPG_MAJOR_VERSION}.${PPG_MINOR_VERSION}"
Expand All @@ -33,7 +42,6 @@ RUN set -ex; \
rpm -i /tmp/percona-release.rpm; \
rm -rf "$GNUPGHOME" /tmp/percona-release.rpm; \
rpm --import /etc/pki/rpm-gpg/PERCONA-PACKAGING-KEY; \
#percona-release setup -y ppg${PPG_MAJOR_VERSION}; \
percona-release enable telemetry ${PPG_REPO}; \
percona-release enable ppg-${PPG_REPO_VERSION} ${PPG_REPO};

Expand All @@ -59,14 +67,17 @@ RUN set -ex; \
RUN useradd -u 1001 -r -g 0 -s /sbin/nologin \
-c "Default Application User" postgres

RUN set -ex; \
export GNUPGHOME="$(mktemp -d)"; \
curl -Lf -o /tmp/perl-JSON.rpm http://vault.centos.org/centos/8/AppStream/x86_64/os/Packages/perl-JSON-2.97.001-2.el8.noarch.rpm; \
rpmkeys --checksig /tmp/perl-JSON.rpm; \
rpm -i /tmp/perl-JSON.rpm

ENV PGDATA /data/db

COPY --from=downloader /downloaded-packages.tar.gz .
RUN tar -xvzf downloaded-packages.tar.gz; \
cd downloaded-packages; \
rpm -ivh perl-*.rpm; \
rpm -ivh perl-JSON*.rpm; \
rm -f /downloaded-packages.tar.gz; \
cd -; \
rm -rf /downloaded-packages /var/cache/dnf /var/cache/yum

RUN set -ex; \
microdnf install -y \
percona-postgresql${PPG_MAJOR_VERSION}-server-${FULL_PERCONA_VERSION} \
Expand Down
Loading
Loading