|
1 | 1 | # ====================== BASE IMAGE ====================== |
2 | | -ARG RHEL_VERSION |
3 | | -FROM ghcr.io/xrplf/ci/rhel-${RHEL_VERSION}:ubi AS base |
4 | 2 |
|
5 | | -# This is not inherited from the base image. |
6 | 3 | ARG RHEL_VERSION |
| 4 | +FROM registry.access.redhat.com/ubi${RHEL_VERSION}/ubi:latest AS base |
7 | 5 |
|
8 | 6 | # Use Bash as the default shell for RUN commands, using the options |
9 | 7 | # `set -o errexit -o pipefail`, and as the entrypoint. |
10 | 8 | SHELL ["/bin/bash", "-e", "-o", "pipefail", "-c"] |
11 | 9 | ENTRYPOINT ["/bin/bash"] |
12 | 10 |
|
| 11 | +# This is not inherited from the base image. |
| 12 | +ARG RHEL_VERSION |
| 13 | + |
| 14 | +# Enable the repository containing packages we need that are missing from the |
| 15 | +# UBI image. The RHEL architecture should be either 'x86_64' or 'aarch64'. |
| 16 | +ARG RHEL_ARCH |
| 17 | +RUN --mount=type=secret,id=RHEL_KEY,env=RHEL_KEY \ |
| 18 | + --mount=type=secret,id=RHEL_ORG,env=RHEL_ORG \ |
| 19 | + subscription-manager register --activationkey="${RHEL_KEY}" --org="${RHEL_ORG}" && \ |
| 20 | + subscription-manager repos --enable=rhel-${RHEL_VERSION}-for-${RHEL_ARCH}-appstream-rpms |
| 21 | + |
13 | 22 | # Install tools that are shared by all stages. |
14 | 23 | RUN <<EOF |
15 | 24 | pkgs=() |
@@ -50,6 +59,10 @@ dnf clean -y all |
50 | 59 | rm -rf /var/cache/dnf/* |
51 | 60 | EOF |
52 | 61 |
|
| 62 | +# Unregister from the subscription manager to avoid the credentials to be used \ |
| 63 | +# by consumers of this image. |
| 64 | +RUN subscription-manager unregister && subscription-manager clean |
| 65 | + |
53 | 66 | # Add symlinks to point to the latest Python versions. The /usr/local/bin |
54 | 67 | # directory is in the PATH before the /usr/bin directory, so the new Python |
55 | 68 | # versions will be used by default. |
|
0 commit comments