Skip to content
Open
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
25 changes: 18 additions & 7 deletions scripts/kata-install/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
FROM registry.access.redhat.com/ubi9/skopeo:9.6-1760517870

RUN mkdir -p /files
ARG UMO_VERSION=0.4.7
ARG TARGETARCH

ADD 50-kata-remote configuration-remote.toml /files/

RUN mkdir -p /scripts
RUN mkdir -p /files /scripts

ADD 50-kata-remote configuration-remote.toml /files/
ADD osc-kata-install.sh osc-configs-script.sh osc-log-level.sh lib.sh /scripts/

RUN curl -sSL "https://github.com/opencontainers/umoci/releases/download/v0.4.7/umoci.amd64" -o "/usr/local/bin/umoci" &&\
chmod +x "/usr/local/bin/umoci"
# fetch the right umoci binary for the target arch
RUN set -eux; \
case "${TARGETARCH}" in \
amd64) UMO_SUFFIX=amd64 ;; \
arm64) UMO_SUFFIX=arm64 ;; \
ppc64le) UMO_SUFFIX=ppc64le ;; \
s390x) UMO_SUFFIX=s390x ;; \
*) echo "Unsupported TARGETARCH: ${TARGETARCH}"; exit 1 ;; \
esac; \
curl -fsSL "https://github.com/opencontainers/umoci/releases/download/v${UMO_VERSION}/umoci.${UMO_SUFFIX}" \
Copy link
Member

Choose a reason for hiding this comment

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

This might be okay for now but we'll have to get umoci from an official image in the RH repository when we go GA.

Copy link
Author

Choose a reason for hiding this comment

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

My searches turned up empty for an official umoci from RH. Happy to update with wherever we want to pull that from.

Copy link
Contributor

Choose a reason for hiding this comment

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

I had a look, there is no packaging.
I think there are two ways out of it:

  • pre-fetch the binaries themselves, from the github repo (which means declaring each binary with path and checksum, and let the CI job pull them before the build starts)
  • build umoci as part of the container image build

I didn't dig to search for alternatives, those are the most obvious. We can decide what option we take when we get to it.

-o /usr/local/bin/umoci; \
chmod +x /usr/local/bin/umoci; \
# optional: verify it runs and prints a version
/usr/local/bin/umoci --version || { echo "umoci not runnable"; exit 1; }

CMD ["/scripts/osc-kata-install.sh"]