1- # ====================== BASE IMAGE ======================
1+ # We want to use the subscription-free Red Hat UBI images, but those only
2+ # provide a subset of the packages available in the full Red Hat Enterprise
3+ # Linux (RHEL) distribution. To get some of the packages we need, we use those
4+ # provided by the Rocky Linux project, which is a community-developed operating
5+ # system designed to be a 100% bug-for-bug compatible alternative to RHEL.
26ARG RHEL_VERSION
7+ FROM rockylinux/rockylinux:${RHEL_VERSION} AS rocky
8+ RUN dnf -y install rpm-sign rpmdevtools
39
10+ # ====================== BASE IMAGE ======================
11+ ARG RHEL_VERSION
412FROM registry.access.redhat.com/ubi${RHEL_VERSION}/ubi:latest AS base
513
614# Use Bash as the default shell for RUN commands, using the options
@@ -11,6 +19,9 @@ ENTRYPOINT ["/bin/bash"]
1119# This is not inherited from the base image.
1220ARG RHEL_VERSION
1321
22+ # Copy rpm binaries from the Rocky Linux image.
23+ COPY --from=rocky /usr/bin/rpm* /usr/bin/
24+
1425# Install tools that are shared by all stages.
1526RUN <<EOF
1627pkgs=()
@@ -30,7 +41,7 @@ pkgs+=(libstdc++-static) # Required to statically link libraries into rippled.
3041pkgs+=(ninja-build) # Required build tool.
3142pkgs+=(perl-Digest-SHA) # Required to compile OpenSSL.
3243if [ "${RHEL_VERSION}" -ge "9" ]; then
33- # Required to compile OpenSSL. Unnecessary on RHEL 8, as these modules are
44+ # Required to compile OpenSSL. Unnecessary in RHEL 8, as these modules are
3445 # included in the base image.
3546 pkgs+=(perl-File-Compare)
3647 pkgs+=(perl-File-Copy)
@@ -42,8 +53,8 @@ pkgs+=(python3.12) # Required build tool.
4253pkgs+=(python3.12-pip) # Package manager for Python applications.
4354pkgs+=(rpm-build) # Required packaging tool.
4455if [ "${RHEL_VERSION}" -ge "9" ]; then
45- # On RHEL 8, the rpmdevtools package is not available in the default repos,
46- # but as we will not be using it we skip its installation .
56+ # Required packaging tool. Unavailable in the RHEL 8 UBI, but it was copied
57+ # from the Rocky Linux image in an earlier step .
4758 pkgs+=(rpmdevtools)
4859fi
4960pkgs+=(vim) # Text editor.
0 commit comments