Skip to content

Commit

Permalink
add oc binary to operator container
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
  • Loading branch information
jan--f committed Dec 20, 2024
1 parent 10fa1d3 commit b62f91c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Dockerfile.obo
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,23 @@ ENV CGO_ENABLED=1
# Build
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -a -tags netgo,osusergo -o manager cmd/operator/main.go

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM --platform linux/amd64 quay.io/openshift/origin-cli-artifacts:4.18 AS origincli

RUN case $(uname -m) in \
x86_64) cp /usr/share/openshift/linux_amd64/oc.rhel9 /tmp/oc ;; \
aarch64) cp /usr/share/openshift/linux_arm64/oc.rhel9 /tmp/oc ;; \
ppc64le) cp /usr/share/openshift/linux_ppc64le/oc.rhel9 /tmp/oc ;; \
s390x) cp /usr/share/openshift/linux_s390x/oc /tmp/oc ;; \
*) echo "Unsupported architecture"; exit 1 ;; \
esac

FROM registry.redhat.io/ubi8/ubi-minimal:8.10-1130
WORKDIR /

RUN microdnf install -y rsync tar xz

COPY --from=origincli /tmp/oc /usr/bin/oc

COPY --from=builder /workspace/manager .
COPY --from=builder --chmod=0755 /workspace/must-gather/collection-scripts/* /usr/bin/
COPY --from=builder /workspace/LICENSE /licenses/.
Expand Down

0 comments on commit b62f91c

Please sign in to comment.