Skip to content

Commit

Permalink
CRW-4582 FIPS support (#1728)
Browse files Browse the repository at this point in the history
Change-Id: Ibc152062a57cc670fafb17ba2389802906bfc64b


move CGO_ENABLED=1 to ENV

Change-Id: I58795da72824b587d916e785dbd4e20251fa7e11

Signed-off-by: Nick Boldt <nboldt@redhat.com>
  • Loading branch information
nickboldt authored Jul 11, 2023
1 parent c4188e1 commit 1c98b9a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@

# https://registry.access.redhat.com/ubi8/go-toolset
FROM registry.access.redhat.com/ubi8/go-toolset:1.19.10-3 as builder
ENV GOPATH=/go/
ENV GOPATH=/go/ \
CGO_ENABLED=1
ARG DEV_HEADER_REWRITE_TRAEFIK_PLUGIN="main"
ARG SKIP_TESTS="false"
USER root

# update RPMs
RUN dnf -y update

# upstream, download zips for every build
# downstream, copy prefetched asset-*.zip into /tmp
RUN curl -sSLo /tmp/asset-header-rewrite-traefik-plugin.zip https://api.github.com/repos/che-incubator/header-rewrite-traefik-plugin/zipball/${DEV_HEADER_REWRITE_TRAEFIK_PLUGIN}
Expand All @@ -40,9 +44,10 @@ COPY controllers/ controllers/
COPY pkg/ pkg/

# build operator
# to test FIPS compliance, run https://github.com/openshift/check-payload#scan-a-container-or-operator-image against a built image
RUN export ARCH="$(uname -m)" && if [[ ${ARCH} == "x86_64" ]]; then export ARCH="amd64"; elif [[ ${ARCH} == "aarch64" ]]; then export ARCH="arm64"; fi && \
if [[ ${SKIP_TESTS} == "false" ]]; then export MOCK_API=true && go test -mod=vendor -v ./...; fi && \
CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} GO111MODULE=on go build -mod=vendor -a -o che-operator main.go
GOOS=linux GOARCH=${ARCH} GO111MODULE=on go build -mod=vendor -a -o che-operator main.go

# https://registry.access.redhat.com/ubi8-minimal
FROM registry.access.redhat.com/ubi8-minimal:8.8-1014
Expand Down

0 comments on commit 1c98b9a

Please sign in to comment.