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,10 +35,8 @@ 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
@@ -54,6 +47,7 @@ COPY README.downstream ./README
5447
5548COPY --from=ose-cli /usr/bin/kubectl /usr/bin/kubectl
5649COPY --from=ose-cli /usr/bin/oc /usr/bin/oc
50+ COPY LICENSE /licenses/
5751
5852USER 65532:65532
5953
@@ -66,7 +60,5 @@ LABEL io.k8s.description="Network Observability CLI"
6660LABEL summary="Network Observability CLI"
6761LABEL maintainer="support@redhat.com"
6862LABEL io.openshift.tags="network-observability-cli"
69- LABEL upstream-vcs-type="git"
70- LABEL upstream-vcs-ref=$COMMIT
7163LABEL description="Network Observability CLI is a lightweight Flow, Packet and Metrics visualization tool for on-demand monitoring."
7264LABEL version=$BUILDVERSION
0 commit comments