Skip to content
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
cleaner solution
  • Loading branch information
dashrews78 committed Oct 1, 2026
commit 0643affeab67a266826a8d5f396bfb78de615e54
11 changes: 2 additions & 9 deletions image/rhel/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
ARG TARGETARCH
ARG PG_VERSION=16

FROM registry.access.redhat.com/ubi9:latest AS ubi-base
FROM registry.access.redhat.com/ubi9/ubi-micro:latest AS ubi-micro-base

# PGDG does not publish s390x RPMs, and UBI only provides PostgreSQL 13.
# Use CentOS Stream's PostgreSQL module for that architecture's download stage.
FROM ubi-base AS downloads-amd64
FROM ubi-base AS downloads-arm64
FROM ubi-base AS downloads-ppc64le
FROM quay.io/centos/centos:stream9 AS downloads-s390x

FROM downloads-${TARGETARCH} AS downloads
FROM ubi-base AS downloads
Comment thread
dashrews78 marked this conversation as resolved.

ARG DEBUG_BUILD=no
ARG PG_VERSION

WORKDIR /
COPY download.sh /download.sh
COPY signatures/RPM-GPG-KEY-CentOS-Official /tmp/
RUN /download.sh

FROM ubi-base AS stackrox_data
Expand Down
7 changes: 4 additions & 3 deletions image/rhel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ This image is built in opinionated way based on the DoD Centralized Artifacts Re
## PostgreSQL clients

`Dockerfile` downloads PostgreSQL client RPMs from PGDG for amd64, arm64, and
ppc64le. For s390x it uses a CentOS Stream 9 download stage because PGDG does not
publish s390x packages and UBI's repositories do not provide the PostgreSQL 16
module. The runtime remains UBI on every architecture.
ppc64le. For s390x, `download.sh` adds the CentOS Stream 9 AppStream repository
to its download commands because PGDG does not publish s390x packages and UBI's
repositories do not provide the PostgreSQL 16 module. The download and runtime
stages use UBI on every architecture.

`PG_VERSION` selects the client major version. The `runtime-base` stage runs
`pg_dump` and `pg_restore` and checks their versions in the runtime filesystem,
Expand Down
6 changes: 4 additions & 2 deletions image/rhel/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ fi
mkdir -p "$output_dir/rpms"

if [[ "$arch" == "s390x" ]]; then
dnf module enable -y "postgresql:${postgres_major}"
dnf install -y --downloadonly --downloaddir=/tmp postgresql postgresql-private-libs
rpm --import /tmp/RPM-GPG-KEY-CentOS-Official
centos_repo="--repofrompath=centos-appstream,https://mirror.stream.centos.org/9-stream/AppStream/${arch}/os/"
dnf "$centos_repo" module enable -y "postgresql:${postgres_major}"
dnf "$centos_repo" install -y --downloadonly --downloaddir=/tmp postgresql postgresql-private-libs
mv /tmp/postgresql-private-libs-*.rpm "${output_dir}/rpms/postgres-libs.rpm"
mv /tmp/postgresql-*.rpm "${output_dir}/rpms/postgres.rpm"
else
Expand Down
Loading