-
Notifications
You must be signed in to change notification settings - Fork 14
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
WIP: Install crictl from RPM #125
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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-1227 | ||
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 && \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I installed wget, tar and gzip so I could unpack the crictl-*-tar.gz, so we wouldn't need them if we're doing an RPM install of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Re: ca-certificates. No, it shouldn’t be needed once we're just installing cri-tools vi dnf. In fact, I believe we can remove all of these ancillary packages. The PR’s initial goal was primarily to see how the addition of the subscription-manager repository would pan out. |
||
${DNF_CMD} -y clean all | ||
|
||
LABEL name="bpfman/bpfman-agent" \ | ||
com.redhat.component="bpfman-agent" \ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know how much bigger this is than the ubi-minimal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double-checking with
image inspect
, I see:so the minimal image is ~half the size.
If we want to persist with the minimal then we could install
subscription-manager
in the minimal image ala:Note: I installed find and xargs as prerequisites because, when installing only subscription-manager, I noticed the following messages at the end of the installation:
Once subscription-manager is installed we can enable the repo: