From c05a225b54d116600e424a582a4bdcae963b5e82 Mon Sep 17 00:00:00 2001 From: Andrew McDermott Date: Thu, 5 Sep 2024 11:46:10 +0100 Subject: [PATCH] WIP: Install crictl from RPM --- Containerfile.bpfman-agent.openshift | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Containerfile.bpfman-agent.openshift b/Containerfile.bpfman-agent.openshift index e81c8cff2..d4da1cc2f 100644 --- a/Containerfile.bpfman-agent.openshift +++ b/Containerfile.bpfman-agent.openshift @@ -1,6 +1,4 @@ # Build the manager binary -ARG BUILDPLATFORM=linux/amd64 - FROM --platform=$BUILDPLATFORM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:v1.22.5-202407301806.g4c8b32d.el9 AS bpfman-agent-build # The following ARGs are set internally by docker/build-push-action in github actions @@ -22,7 +20,7 @@ COPY . . # by leaving it empty we can ensure that the container and binary shipped on it will have the same platform. RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -mod vendor -o bpfman-agent ./cmd/bpfman-agent/main.go -FROM --platform=$TARGETPLATFORM registry.access.redhat.com/ubi9/ubi-minimal:9.4-1194 +FROM --platform=$TARGETPLATFORM registry.access.redhat.com/ubi9/ubi:9.4 ARG DNF_CMD="microdnf" ARG TARGETARCH @@ -31,13 +29,12 @@ ARG TARGETPLATFORM WORKDIR / COPY --from=bpfman-agent-build /usr/src/bpfman-operator/bpfman-agent . -# Install crictl -RUN ${DNF_CMD} -y install wget tar gzip ca-certificates -ARG VERSION="v1.31.0" -RUN wget https://github.com/kubernetes-sigs/cri-tools/releases/download/${VERSION}/crictl-${VERSION}-linux-${TARGETARCH}.tar.gz -RUN tar zxvf crictl-${VERSION}-linux-${TARGETARCH}.tar.gz -C /usr/local/bin -RUN rm -f crictl-${VERSION}-linux-${TARGETARCH}.tar.gz -RUN ${DNF_CMD} -y clean all +RUN ls -lR /etc/pki + +RUN subscription-manager repos --enable=rhocp-4_DOT_17-for-rhel-9-x86_64-rpms + +RUN ${DNF_CMD} -y install wget tar gzip ca-certificates cri-tools && \ + ${DNF_CMD} -y clean all LABEL name="bpfman/bpfman-agent" \ com.redhat.component="bpfman-agent" \