Skip to content

Commit

Permalink
chore: update base image to UBI9 (#40)
Browse files Browse the repository at this point in the history
Signed-off-by: Niccolò Fei <[email protected]>
  • Loading branch information
NiccoloFei authored Jul 29, 2024
1 parent c40f842 commit bda3856
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
uses: docker/build-push-action@v6
with:
secrets: |
"cs_script=${{ secrets.CS_SCRIPT }}"
"cs_token=${{ secrets.CLOUDSMITH_READ_ALL }}"
platforms: ${{ env.PLATFORMS }}
context: .
push: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ jobs:
-
name: Get latest UBI
run: |
UBI_VERSION=$(skopeo list-tags docker://registry.access.redhat.com/ubi8-minimal | jq -r '.Tags[]' | grep -vE "(latest|source|.att|.sig)" | sort -Vr | head -n1)
UBI_VERSION=$(skopeo list-tags docker://registry.access.redhat.com/ubi9-minimal | jq -r '.Tags[]' | grep -vE "(latest|source|.att|.sig)" | sort -Vr | head -n1)
if [ -z "$UBI_VERSION" ]
then
echo "UBI8 minimal latest tag could not be retrieved"
echo "UBI9 minimal latest tag could not be retrieved"
exit 0
fi
echo "UBI_VERSION=$UBI_VERSION" >> $GITHUB_ENV
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
uses: docker/build-push-action@v6
with:
secrets: |
"cs_script=${{ secrets.CS_SCRIPT }}"
"cs_token=${{ secrets.CLOUDSMITH_READ_ALL }}"
context: .
load: true
push: false
Expand Down
22 changes: 11 additions & 11 deletions Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
ARG UBI_VERSION=%%UBI_VERSION%%
ARG PGBOUNCER_VERSION=%%PGBOUNCER_VERSION%%

FROM registry.access.redhat.com/ubi8/ubi-minimal:${UBI_VERSION} AS build
FROM registry.access.redhat.com/ubi9/ubi-minimal:${UBI_VERSION} AS build
ARG PGBOUNCER_VERSION

# Install build dependencies. EPEL repository is required by udns
RUN set -xe ; \
rpm -i https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm ; \
rpm -i https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm ; \
microdnf -y install make libevent libevent-devel pkg-config openssl openssl-devel \
tar gzip gcc udns udns-devel ; \
microdnf -y clean all --enablerepo='*' ; \
Expand All @@ -17,7 +17,7 @@ RUN set -xe ; \
./configure --without-cares --with-udns ; \
make

FROM registry.access.redhat.com/ubi8/ubi-minimal:${UBI_VERSION}
FROM registry.access.redhat.com/ubi9/ubi-minimal:${UBI_VERSION}
ARG PGBOUNCER_VERSION
ARG TARGETARCH

Expand All @@ -27,29 +27,29 @@ LABEL name="PgBouncer Container Images" \
version="%%PGBOUNCER_VERSION%%" \
release="%%IMAGE_RELEASE_VERSION%%" \
summary="Container images for PgBouncer (connection pooler for PostgreSQL)." \
description="This Docker image contains PgBouncer based on RedHat Universal Base Images (UBI) 8 minimal."
description="This Docker image contains PgBouncer based on RedHat Universal Base Images (UBI) 9 minimal."

COPY root/ /

RUN --mount=type=secret,id=cs_script,target=/run/secrets/cs_script.sh \
RUN --mount=type=secret,id=cs_token \
set -xe ; \
rpm -i https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm ; \
rpm -i https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm ; \
ARCH="${TARGETARCH}" ; \
base_url="https://download.postgresql.org/pub/repos/yum/reporpms" ; \
case $ARCH in \
amd64) \
rpm -i "${base_url}/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm" ;; \
rpm -i "${base_url}/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm" ;; \
arm64) \
rpm -i "${base_url}/EL-8-aarch64/pgdg-redhat-repo-latest.noarch.rpm" ;; \
rpm -i "${base_url}/EL-9-aarch64/pgdg-redhat-repo-latest.noarch.rpm" ;; \
ppc64le) \
rpm -i "${base_url}/EL-8-ppc64le/pgdg-redhat-repo-latest.noarch.rpm" ;; \
curl -u token:$(cat /run/secrets/cs_token) -1sLf https://downloads.enterprisedb.com/basic/enterprise/setup.rpm.sh | bash ;; \
s390x) \
bash /run/secrets/cs_script.sh ;; \
curl -u token:$(cat /run/secrets/cs_token) -1sLf https://downloads.enterprisedb.com/basic/edb/setup.rpm.sh | bash ;; \
*) \
exit 1 ;; \
esac ; \
microdnf -y install libevent openssl udns shadow-utils findutils ; \
microdnf -y install --setopt=install_weak_deps=0 --setopt=tsflags=nodocs --nodocs --noplugins postgresql13 ; \
microdnf -y install --setopt=install_weak_deps=0 --setopt=tsflags=nodocs --nodocs --noplugins postgresql16 ; \
microdnf -y clean all --enablerepo='*' ; \
rm -fr /etc/yum.repos.d/enterprisedb-edb.repo ; \
rm -fr /tmp/* ; \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# PgBouncer Container Images by EnterpriseDB

Maintenance scripts to generate Immutable Application Containers for PgBouncer,
based on UBI 8 minimal.
based on UBI 9 minimal.

These images are customised to work with
[Cloud Native PostgreSQL operators by EDB](https://docs.enterprisedb.io/cloud-native-postgresql/)
Expand Down

0 comments on commit bda3856

Please sign in to comment.