Skip to content

Commit

Permalink
rely on brew image for downstream
Browse files Browse the repository at this point in the history
  • Loading branch information
jpinsonneau committed Dec 16, 2024
1 parent 3a913ef commit fd682cd
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Dockerfile.downstream
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
ARG TARGETARCH=amd64
ARG COMMIT

# Make kubectl & oc scripts available for copy
FROM brew.registry.redhat.io/openshift4/ose-cli-rhel9:v4.17.0-202412032103.p0.g13001b0.assembly.stream.el9 as ose-cli

# Build the manager binary
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:v1.22.5-202407301806.g4c8b32d.el9 as builder

Expand All @@ -25,12 +28,6 @@ COPY .mk/ .mk/
# Build collector
RUN GOARCH=$TARGETARCH make compile

# Install oc to allow collector to run commands
RUN set -x; \
OC_TAR_URL="https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/ocp/latest/openshift-client-linux.tar.gz" && \
curl -L -q -o /tmp/oc.tar.gz "$OC_TAR_URL" && \
tar -C /tmp -xvf /tmp/oc.tar.gz oc kubectl

# Embedd commands in case users want to pull it from collector image
RUN USER=netobserv VERSION=main make oc-commands

Expand All @@ -40,10 +37,14 @@ RUN mkdir -p output
# Create final image from ubi + built binary and command
FROM --platform=linux/$TARGETARCH registry.access.redhat.com/ubi9/ubi:9.4
WORKDIR /

COPY --from=builder /opt/app-root/build .
COPY --from=builder /tmp/oc /usr/bin/oc
COPY --from=builder /tmp/kubectl /usr/bin/kubectl
COPY --from=builder --chown=65532:65532 /opt/app-root/output /output

COPY --from=ose-cli /kubectl /usr/bin/kubectl
COPY --from=ose-cli /oc /usr/bin/oc

USER 65532:65532

ENTRYPOINT ["/network-observability-cli"]
Expand Down

0 comments on commit fd682cd

Please sign in to comment.