We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 329dc4a commit d35f387Copy full SHA for d35f387
src/apiserver/Dockerfile
@@ -1,4 +1,4 @@
1
-FROM golang:1.23.2 as builder
+FROM --platform=$BUILDPLATFORM golang:1.23.2 as builder
2
3
ARG GOPROXY
4
ENV GOPROXY=${GOPROXY}
@@ -8,9 +8,12 @@ WORKDIR /workspace
8
# Copy the go source
9
COPY . ./
10
11
+ARG TARGETOS
12
+ARG TARGETARCH
13
+
14
# Build
15
RUN go mod tidy
-RUN CGO_ENABLED=0 GOOS=linux go build -a -o apiserver main.go
16
+RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -a -o apiserver main.go
17
18
# Use distroless as minimal base image to package the manager binary
19
# Refer to https://github.com/GoogleContainerTools/distroless for more details
0 commit comments