Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NETOBSERV-2112: Make build FIPS compliant #169

Merged
merged 1 commit into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN set -x; \
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
# Embed commands in case users want to pull it from collector image
RUN USER=netobserv VERSION=main make oc-commands

# Prepare output dir
Expand Down
20 changes: 11 additions & 9 deletions Dockerfile.downstream
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,28 @@ FROM registry.redhat.io/openshift4/ose-cli-rhel9:v4.17.0-202412032103.p0.g13001b
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:v1.23 as builder

ARG TARGETARCH
ARG TARGETPLATFORM
ARG VERSION="unknown"
ARG BUILDVERSION="1.8.0"

WORKDIR /opt/app-root

COPY cmd cmd
COPY main.go main.go
COPY go.mod go.mod
COPY go.sum go.sum
COPY vendor/ vendor/

# Build collector
ENV GOEXPERIMENT strictfipsruntime
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

# We still need Makefile & resources for oc-commands; copy them after go build for caching
COPY commands/ commands/
COPY res/ res/
COPY scripts/ scripts/
COPY vendor/ vendor/
COPY Makefile Makefile
COPY .mk/ .mk/

# Build collector
RUN GOARCH=$TARGETARCH make compile

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

# Prepare output dir
Expand Down Expand Up @@ -58,5 +60,5 @@ LABEL summary="Network Observability CLI"
LABEL maintainer="support@redhat.com"
LABEL io.openshift.tags="network-observability-cli"
LABEL upstream-vcs-type="git"
LABEL upstream-vcs-ref="$COMMIT"
LABEL version="1.8.0"
LABEL upstream-vcs-ref=$COMMIT
LABEL version=$BUILDVERSION