Skip to content

Commit 9279a77

Browse files
committed
Removes helper image and adds logic back to RHEL image
1 parent 96e0708 commit 9279a77

File tree

6 files changed

+55
-282
lines changed

6 files changed

+55
-282
lines changed

.github/workflows/rhel-ubi.yml

Lines changed: 0 additions & 180 deletions
This file was deleted.

.github/workflows/rhel.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ jobs:
4242
architecture:
4343
- platform: linux/amd64
4444
runner: ubuntu-24.04
45+
name: x86_64
4546
- platform: linux/arm64
4647
runner: ubuntu-24.04-arm
48+
name: aarch64
4749
os:
4850
- release: 8
4951
compiler_name: gcc
@@ -122,6 +124,7 @@ jobs:
122124
GCOVR_VERSION=${{ env.GCOVR_VERSION }}
123125
CMAKE_VERSION=${{ env.CMAKE_VERSION }}
124126
MOLD_VERSION=${{ env.MOLD_VERSION }}
127+
RHEL_ARCH=${{ matrix.architecture.name }}
125128
RHEL_VERSION=${{ matrix.os.release }}
126129
context: .
127130
file: docker/rhel/Dockerfile
@@ -130,6 +133,9 @@ jobs:
130133
provenance: mode=max
131134
push: ${{ env.PUSH }}
132135
sbom: true
136+
secrets: |
137+
"RHEL_KEY=${{ secrets.RHEL_KEY }}"
138+
"RHEL_ORG=${{ secrets.RHEL_ORG }}"
133139
labels: ${{ steps.meta.outputs.labels }}
134140
target: ${{ matrix.os.compiler_name }}
135141
- name: Export digest

docker/rhel-ubi/Dockerfile

Lines changed: 0 additions & 14 deletions
This file was deleted.

docker/rhel-ubi/README.md

Lines changed: 0 additions & 85 deletions
This file was deleted.

docker/rhel/Dockerfile

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
# ====================== BASE IMAGE ======================
2-
ARG RHEL_VERSION
3-
FROM ghcr.io/xrplf/ci/rhel-${RHEL_VERSION}:ubi AS base
42

5-
# This is not inherited from the base image.
63
ARG RHEL_VERSION
4+
FROM registry.access.redhat.com/ubi${RHEL_VERSION}/ubi:latest AS base
75

86
# Use Bash as the default shell for RUN commands, using the options
97
# `set -o errexit -o pipefail`, and as the entrypoint.
108
SHELL ["/bin/bash", "-e", "-o", "pipefail", "-c"]
119
ENTRYPOINT ["/bin/bash"]
1210

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+
1322
# Install tools that are shared by all stages.
1423
RUN <<EOF
1524
pkgs=()
@@ -50,6 +59,10 @@ dnf clean -y all
5059
rm -rf /var/cache/dnf/*
5160
EOF
5261

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+
5366
# Add symlinks to point to the latest Python versions. The /usr/local/bin
5467
# directory is in the PATH before the /usr/bin directory, so the new Python
5568
# versions will be used by default.

0 commit comments

Comments
 (0)