1- # We do not use --platform feature to auto fill this ARG because of incompatibility between podman and docker
2- ARG TARGETARCH
3- ARG COMMIT
1+ ARG BUILDVERSION
42
53# Make kubectl & oc scripts available for copy
64FROM registry.redhat.io/openshift4/ose-cli-rhel9:v4.18.0-202502040032.p0.ga50d4c0.assembly.stream.el9 as ose-cli
75
86# Build the manager binary
97FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:v1.23 as builder
10-
11- ARG TARGETARCH=amd64
12- ARG COMMIT
13- ARG BUILDVERSION="1.9.0"
14- ARG IMAGE=registry.redhat.io/network-observability/network-observability-cli-rhel9:1.8
15- ARG AGENT_IMAGE=registry.redhat.io/network-observability/network-observability-ebpf-agent-rhel9:1.8
8+ ARG BUILDVERSION
9+ ARG IMAGE=registry.redhat.io/network-observability/network-observability-cli-rhel9:${BUILDVERSION}
10+ ARG AGENT_IMAGE=registry.redhat.io/network-observability/network-observability-ebpf-agent-rhel9:${BUILDVERSION}
1611
1712WORKDIR /opt/app-root
1813
@@ -24,7 +19,7 @@ COPY vendor/ vendor/
2419
2520# Build collector
2621ENV GOEXPERIMENT strictfipsruntime
27- RUN GOARCH=$TARGETARCH go build -tags strictfipsruntime -ldflags "-X 'main.buildVersion=${BUILDVERSION}' -X 'main.buildDate=`date +%Y-%m-%d\ %H:%M`'" -mod vendor -a -o build/network-observability-cli
22+ RUN go build -tags strictfipsruntime -ldflags "-X 'main.buildVersion=${BUILDVERSION}' -X 'main.buildDate=`date +%Y-%m-%d\ %H:%M`'" -mod vendor -a -o build/network-observability-cli
2823
2924# We still need Makefile & resources for oc-commands; copy them after go build for caching
3025COPY commands/ commands/
@@ -40,15 +35,15 @@ RUN USER=netobserv VERSION="$BUILDVERSION" IMAGE="$IMAGE" AGENT_IMAGE="$AGENT_IM
4035RUN mkdir -p output
4136
4237# Create final image from ubi + built binary and command
43- FROM --platform=linux/$TARGETARCH registry.access.redhat.com/ubi9/ubi:9.5-1741850090
44-
45- ARG COMMIT
46- ARG BUILDVERSION="1.9.0"
38+ FROM registry.access.redhat.com/ubi9/ubi:9.5-1741850090
39+ ARG BUILDVERSION
4740
4841WORKDIR /
4942
5043COPY --from=builder /opt/app-root/build .
5144COPY --from=builder --chown=65532:65532 /opt/app-root/output /output
45+ COPY LICENSE /licenses/
46+ COPY README.downstream ./README
5247
5348COPY --from=ose-cli /usr/bin/kubectl /usr/bin/kubectl
5449COPY --from=ose-cli /usr/bin/oc /usr/bin/oc
@@ -64,7 +59,5 @@ LABEL io.k8s.description="Network Observability CLI"
6459LABEL summary="Network Observability CLI"
6560LABEL maintainer="
[email protected] "
6661LABEL io.openshift.tags="network-observability-cli"
67- LABEL upstream-vcs-type="git"
68- LABEL upstream-vcs-ref=$COMMIT
6962LABEL description="Network Observability CLI is a lightweight Flow, Packet and Metrics visualization tool for on-demand monitoring."
7063LABEL version=$BUILDVERSION
0 commit comments