Skip to content

Commit 07999a4

Browse files
committed
update dockerfile to support muti-arch
1 parent b9e7ccd commit 07999a4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ FROM ${GOLANG_IMAGE} AS golang
77
FROM registry.access.redhat.com/ubi8/ubi@sha256:fd3bf22d0593e2ed26a1c74ce161c52295711a67de677b5938c87704237e49b0 AS builder
88
ARG GOLANG_VERSION=1.23.0
99

10+
ARG TARGETOS TARGETARCH
11+
RUN echo "GOOS=${TARGETOS} GOARCH=${TARGETARCH}"
12+
1013
# Install system dependencies
1114
RUN dnf upgrade -y && dnf install -y \
1215
gcc \
@@ -34,7 +37,7 @@ COPY pkg/ pkg/
3437

3538
# Build
3639
USER root
37-
RUN CGO_ENABLED=1 GOOS=linux GOARCH=${GOARCH} make go-build-for-image
40+
RUN CGO_ENABLED=1 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} make go-build-for-image
3841

3942
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8
4043
WORKDIR /

0 commit comments

Comments
 (0)