Skip to content

Commit a0a1bae

Browse files
authored
chore: update Dockerfile images for Konflux (#13)
Signed-off-by: Alberto Falossi <afalossi@redhat.com>
1 parent deb75c2 commit a0a1bae

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
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

34
WORKDIR /src
45
COPY go.mod go.mod
@@ -9,13 +10,17 @@ COPY cmd cmd
910
COPY pkg pkg
1011
COPY 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}
1318
ENV CGO_ENABLED=1
1419
ENV GOFLAGS=-mod=readonly
1520
ENV GOEXPERIMENT=strictfipsruntime
1621
RUN 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

2025
WORKDIR /
2126
COPY --from=builder /bin/cluster-health-analyzer /bin/cluster-health-analyzer

0 commit comments

Comments
 (0)