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 22, 2024
1 parent 10fa1d3 commit 1364996
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Dockerfile.obo
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,24 @@ 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 ARCH=$(uname -m); \
case ${ARCH} 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 ${ARCH}"; 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 1364996

Please sign in to comment.