File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 1- FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.22-openshift-4.17 AS builder
1+ FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_1.22 as builder
2+ ARG TARGETARCH
23
34WORKDIR /src
45COPY go.mod go.mod
@@ -9,13 +10,17 @@ COPY cmd cmd
910COPY pkg pkg
1011COPY main.go main.go
1112
12- ENV GOOS=linux
13+ ENV GOOS=${TARGETOS:-linux}
14+ # GOARCH has no default, so the binary builds for the host. On Apple M1, BUILDPLATFORM is set to
15+ # linux/arm64; on Apple x86, it's linux/amd64. Leaving it empty ensures the container and binary
16+ # match the host platform.
17+ ENV GOARCH=${TARGETARCH}
1318ENV CGO_ENABLED=1
1419ENV GOFLAGS=-mod=readonly
1520ENV GOEXPERIMENT=strictfipsruntime
1621RUN go build -tags strictfipsruntime -o /bin/cluster-health-analyzer
1722
18- FROM registry.ci.openshift.org/ocp/4.17:base-rhel9
23+ FROM registry.redhat.io/rhel9-2-els/rhel:9.2
1924
2025WORKDIR /
2126COPY --from=builder /bin/cluster-health-analyzer /bin/cluster-health-analyzer
You can’t perform that action at this time.
0 commit comments