File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed
Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ RUN set -x; \
3131 curl -L -q -o /tmp/oc.tar.gz "$OC_TAR_URL" && \
3232 tar -C /tmp -xvf /tmp/oc.tar.gz oc kubectl
3333
34- # Embedd commands in case users want to pull it from collector image
34+ # Embed commands in case users want to pull it from collector image
3535RUN USER=netobserv VERSION=main make oc-commands
3636
3737# Prepare output dir
Original file line number Diff line number Diff line change @@ -11,26 +11,28 @@ FROM registry.redhat.io/openshift4/ose-cli-rhel9:v4.17.0-202412032103.p0.g13001b
1111FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:v1.23 as builder
1212
1313ARG TARGETARCH
14- ARG TARGETPLATFORM
15- ARG VERSION="unknown"
14+ ARG BUILDVERSION="1.8.0"
1615
1716WORKDIR /opt/app-root
1817
1918COPY cmd cmd
2019COPY main.go main.go
2120COPY go.mod go.mod
2221COPY go.sum go.sum
22+ COPY vendor/ vendor/
23+
24+ # Build collector
25+ ENV GOEXPERIMENT strictfipsruntime
26+ 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
27+
28+ # We still need Makefile & resources for oc-commands; copy them after go build for caching
2329COPY commands/ commands/
2430COPY res/ res/
2531COPY scripts/ scripts/
26- COPY vendor/ vendor/
2732COPY Makefile Makefile
2833COPY .mk/ .mk/
2934
30- # Build collector
31- RUN GOARCH=$TARGETARCH make compile
32-
33- # Embedd commands in case users want to pull it from collector image
35+ # Embed commands in case users want to pull it from collector image
3436RUN USER=netobserv VERSION=main IMAGE="$IMAGE" AGENT_IMAGE="$AGENT_IMAGE" make oc-commands
3537
3638# Prepare output dir
@@ -58,5 +60,5 @@ LABEL summary="Network Observability CLI"
5860LABEL maintainer="support@redhat.com"
5961LABEL io.openshift.tags="network-observability-cli"
6062LABEL upstream-vcs-type="git"
61- LABEL upstream-vcs-ref=" $COMMIT"
62- LABEL version="1.8.0"
63+ LABEL upstream-vcs-ref=$COMMIT
64+ LABEL version=$BUILDVERSION
You can’t perform that action at this time.
0 commit comments