diff --git a/build/Dockerfile b/build/Dockerfile index 158887c48fe8..5a39abe9e8d2 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,6 +1,15 @@ ARG BUILDIMAGE FROM $BUILDIMAGE -RUN apk add --no-cache make gcc musl-dev binutils-gold + +ARG TARGETARCH +RUN set -ex; \ +# Need to use the gold linker on ARM, Go really wants to have it. +# https://github.com/golang/go/blob/go1.22.4/src/cmd/link/internal/ld/lib.go#L1622-L1641 + case "$TARGETARCH" in \ + arm*) binutils=binutils-gold ;; \ + *) binutils=binutils ;; \ + esac; \ + apk add --no-cache make gcc musl-dev "$binutils" ENV \ HOME="/run/k0s-build" \