Skip to content

Commit 43646af

Browse files
committed
Pull missing packages from Rocky
1 parent f14beef commit 43646af

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

docker/rhel/Dockerfile

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
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.
26
ARG 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
412
FROM 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.
1220
ARG 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.
1526
RUN <<EOF
1627
pkgs=()
@@ -30,7 +41,7 @@ pkgs+=(libstdc++-static) # Required to statically link libraries into rippled.
3041
pkgs+=(ninja-build) # Required build tool.
3142
pkgs+=(perl-Digest-SHA) # Required to compile OpenSSL.
3243
if [ "${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.
4253
pkgs+=(python3.12-pip) # Package manager for Python applications.
4354
pkgs+=(rpm-build) # Required packaging tool.
4455
if [ "${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)
4859
fi
4960
pkgs+=(vim) # Text editor.

0 commit comments

Comments
 (0)