Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Podvm builder dockerfile #517

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions config/peerpods/podvm/Dockerfile.podvm-builder.openshift
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM registry.access.redhat.com/ubi9/ubi:9.5-1736404036

# azure-podvm-image-handler.sh script under /scripts/azure-podvm-image-handler.sh
# aws-podvm-image-handler.sh script under /scripts/aws-podvm-image-handler.sh
# sources for cloud-api-adaptor under /src/cloud-api-adaptor
# The podvm binaries are expected to be under /payload/podvm-binaries.tar.gz
# Binaries like kubectl, packer and yq under /usr/local/bin will be installed by the scripts


LABEL kata_src=https://github.com/openshift/kata-containers
LABEL kata_src_commit=osc-release

ARG ORG_ID
ARG ACTIVATION_KEY

Copy link
Member

@beraldoleal beraldoleal Jan 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About the subscription code that was here... I'm not familiar on how konflux handles this (maybe @spotlesstofu).

But, I was wondering if something like this would work:

RUN if [[ -z "${KONFLUX_BUILD}" ]]; then \
    rm -f /etc/rhsm-host && rm -f /etc/pki/entitlement-host; \
    subscription-manager register --org=${ORG_ID} --activationkey=${ACTIVATION_KEY}; \
    fi

Not sure if the konflux already exposes any variable, but if not, maybe we can configure those variables within the tekton folder. This way we could avoid having two dockerfiles. Wdyt?

RUN mkdir -p /scripts

ADD lib.sh libvirt-podvm-image-handler.sh aws-podvm-image-handler.sh azure-podvm-image-handler.sh /scripts/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably this will conflict with #519 but I can handle on my side. Just adding a note so we (I) don't forget :)


RUN /scripts/azure-podvm-image-handler.sh -- install_rpms

ARG CAA_SRC=https://github.com/openshift/cloud-api-adaptor
ARG CAA_REF=osc-release
ARG CERT_RPM


ENV CAA_SRC=$CAA_SRC
ENV CAA_REF=$CAA_REF
ENV CERT_RPM=$CERT_RPM

RUN if [[ -n "$CERT_RPM" ]] ; then \
dnf install -y $CERT_RPM ; \
fi


RUN git clone ${CAA_SRC} -b ${CAA_REF} /src/cloud-api-adaptor

ADD podvm-builder.sh /podvm-builder.sh

ENTRYPOINT ["/podvm-builder.sh"]