Skip to content

Commit 90d5e8f

Browse files
authored
Make build FIPS compliant (#170)
1 parent f70930d commit 90d5e8f

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
3535
RUN USER=netobserv VERSION=main make oc-commands
3636

3737
# Prepare output dir

Dockerfile.downstream

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,28 @@ FROM registry.redhat.io/openshift4/ose-cli-rhel9:v4.17.0-202412032103.p0.g13001b
1111
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:v1.23 as builder
1212

1313
ARG TARGETARCH
14-
ARG TARGETPLATFORM
15-
ARG VERSION="unknown"
14+
ARG BUILDVERSION="1.8.0"
1615

1716
WORKDIR /opt/app-root
1817

1918
COPY cmd cmd
2019
COPY main.go main.go
2120
COPY go.mod go.mod
2221
COPY 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
2329
COPY commands/ commands/
2430
COPY res/ res/
2531
COPY scripts/ scripts/
26-
COPY vendor/ vendor/
2732
COPY Makefile Makefile
2833
COPY .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
3436
RUN 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"
5860
LABEL maintainer="support@redhat.com"
5961
LABEL io.openshift.tags="network-observability-cli"
6062
LABEL 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

0 commit comments

Comments
 (0)