Skip to content

Commit

Permalink
DNM: konflux build: add subscription to the release image
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Ropé <[email protected]>
  • Loading branch information
littlejawa committed Feb 10, 2025
1 parent 9ca5104 commit 383b2ab
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions podvm-payload/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ USER root
# If you are running a UBI container on a registered and subscribed RHEL host,
# the main RHEL Server repository is enabled inside the standard UBI container.
# Uncomment this and provide the associated ARG variables to register.
# To make local build, create a folder named "activation-key", put your key and org
# ID as separate files in it, and add the following to the RUN command below, to
# mount the folder during the build:
# --mount=type=bind,target=/activation-key,source=activation-key
RUN if command -v subscription-manager; then \
REPO_ARCH=$(uname -m) && \
subscription-manager register --org "$(cat /activation-key/org)" --activationkey "$(cat /activation-key/activationkey)" && \
Expand Down Expand Up @@ -95,6 +99,14 @@ COPY --from=go_builder /artifacts /artifacts
COPY --from=rust_builder /artifacts /artifacts
COPY --from=rust_builder_1_80 /artifacts /artifacts

RUN if command -v subscription-manager; then \
REPO_ARCH=$(uname -m) && \
subscription-manager register --org "$(cat /activation-key/org)" --activationkey "$(cat /activation-key/activationkey)" && \
subscription-manager repos --enable rhel-9-for-${REPO_ARCH}-appstream-rpms --enable codeready-builder-for-rhel-9-${REPO_ARCH}-rpms; \
else \
dnf -y install 'dnf-command(config-manager)' && dnf config-manager --enable crb; \
fi

RUN microdnf install -y tar gzip && microdnf clean all

# Create the final tarball and remove /artifacts to save space
Expand Down

0 comments on commit 383b2ab

Please sign in to comment.