Skip to content

Commit 4a68e7a

Browse files
decobotclaude
andcommitted
perf: use BUILDPLATFORM for Go builder stage to avoid QEMU emulation
Without --platform=$BUILDPLATFORM, the golang builder image is pulled for the target arch (arm64) and run via QEMU on the amd64 runner, making builds extremely slow (~25min). With BUILDPLATFORM, the builder always runs natively on the host arch while cross-compiling via GOARCH. Build time should drop from ~25min to ~3-5min. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent dc8240d commit 4a68e7a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
FROM golang:1.24 AS builder
2+
FROM --platform=$BUILDPLATFORM golang:1.24 AS builder
33
ARG TARGETOS
44
ARG TARGETARCH
55

0 commit comments

Comments
 (0)