mirror of
https://github.com/livekit/livekit.git
synced 2026-10-29 12:02:51 +00:00
The build already cross-compiles explicitly (CGO_ENABLED=0, GOOS=linux, GOARCH=$TARGETARCH), so the toolchain never needs to match the target arch. Without --platform=$BUILDPLATFORM a cross-arch build runs the entire Go compilation under QEMU emulation for a byte-identical binary: building linux/amd64 on an arm64 host went from minutes to still-running after ten. Only the final stage stays on $TARGETPLATFORM, where it belongs. go-version.sh reads the Go version out of the builder's FROM line, so its pattern now accepts an optional --platform flag before the image.