From 8426bbb144ff4507d189ca12ee7e09c3545717ac Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Thu, 21 Aug 2025 13:07:19 -0700 Subject: [PATCH] Explicitly install `gold` on `arm64` --- 1.24/bookworm/Dockerfile | 10 ++++++++++ 1.24/trixie/Dockerfile | 10 ++++++++++ 1.25/bookworm/Dockerfile | 10 ++++++++++ 1.25/trixie/Dockerfile | 10 ++++++++++ Dockerfile-linux.template | 10 ++++++++++ tip/bookworm/Dockerfile | 10 ++++++++++ tip/trixie/Dockerfile | 10 ++++++++++ 7 files changed, 70 insertions(+) diff --git a/1.24/bookworm/Dockerfile b/1.24/bookworm/Dockerfile index 348aa6c9..da6a7293 100644 --- a/1.24/bookworm/Dockerfile +++ b/1.24/bookworm/Dockerfile @@ -114,6 +114,16 @@ RUN set -eux; \ make \ pkg-config \ ; \ +# go depends on "gold" explicitly on arm64 +# https://github.com/docker-library/golang/issues/570 (go depends on "gold" explicitly on arm64) +# https://github.com/golang/go/issues/22040 +# ... and as of trixie, "gold" is removed from the "binutils" package: +# > WARNING: gold is being removed from binutils, and is deprecated upstream. +# (and available as "binutils-gold" which is also a virtual on bookworm so we can reasonably be explicit everywhere) + dpkgArch="$(dpkg --print-architecture)"; \ + if [ "$dpkgArch" = 'arm64' ]; then \ + apt-get install -y --no-install-recommends binutils-gold; \ + fi; \ rm -rf /var/lib/apt/lists/* ENV GOLANG_VERSION 1.24.6 diff --git a/1.24/trixie/Dockerfile b/1.24/trixie/Dockerfile index fe6900f9..b122f97e 100644 --- a/1.24/trixie/Dockerfile +++ b/1.24/trixie/Dockerfile @@ -114,6 +114,16 @@ RUN set -eux; \ make \ pkg-config \ ; \ +# go depends on "gold" explicitly on arm64 +# https://github.com/docker-library/golang/issues/570 (go depends on "gold" explicitly on arm64) +# https://github.com/golang/go/issues/22040 +# ... and as of trixie, "gold" is removed from the "binutils" package: +# > WARNING: gold is being removed from binutils, and is deprecated upstream. +# (and available as "binutils-gold" which is also a virtual on bookworm so we can reasonably be explicit everywhere) + dpkgArch="$(dpkg --print-architecture)"; \ + if [ "$dpkgArch" = 'arm64' ]; then \ + apt-get install -y --no-install-recommends binutils-gold; \ + fi; \ rm -rf /var/lib/apt/lists/* ENV GOLANG_VERSION 1.24.6 diff --git a/1.25/bookworm/Dockerfile b/1.25/bookworm/Dockerfile index 518de67b..cc92a728 100644 --- a/1.25/bookworm/Dockerfile +++ b/1.25/bookworm/Dockerfile @@ -114,6 +114,16 @@ RUN set -eux; \ make \ pkg-config \ ; \ +# go depends on "gold" explicitly on arm64 +# https://github.com/docker-library/golang/issues/570 (go depends on "gold" explicitly on arm64) +# https://github.com/golang/go/issues/22040 +# ... and as of trixie, "gold" is removed from the "binutils" package: +# > WARNING: gold is being removed from binutils, and is deprecated upstream. +# (and available as "binutils-gold" which is also a virtual on bookworm so we can reasonably be explicit everywhere) + dpkgArch="$(dpkg --print-architecture)"; \ + if [ "$dpkgArch" = 'arm64' ]; then \ + apt-get install -y --no-install-recommends binutils-gold; \ + fi; \ rm -rf /var/lib/apt/lists/* ENV GOLANG_VERSION 1.25.0 diff --git a/1.25/trixie/Dockerfile b/1.25/trixie/Dockerfile index 725faffe..a794303e 100644 --- a/1.25/trixie/Dockerfile +++ b/1.25/trixie/Dockerfile @@ -114,6 +114,16 @@ RUN set -eux; \ make \ pkg-config \ ; \ +# go depends on "gold" explicitly on arm64 +# https://github.com/docker-library/golang/issues/570 (go depends on "gold" explicitly on arm64) +# https://github.com/golang/go/issues/22040 +# ... and as of trixie, "gold" is removed from the "binutils" package: +# > WARNING: gold is being removed from binutils, and is deprecated upstream. +# (and available as "binutils-gold" which is also a virtual on bookworm so we can reasonably be explicit everywhere) + dpkgArch="$(dpkg --print-architecture)"; \ + if [ "$dpkgArch" = 'arm64' ]; then \ + apt-get install -y --no-install-recommends binutils-gold; \ + fi; \ rm -rf /var/lib/apt/lists/* ENV GOLANG_VERSION 1.25.0 diff --git a/Dockerfile-linux.template b/Dockerfile-linux.template index a2a8db8d..6af4ce94 100644 --- a/Dockerfile-linux.template +++ b/Dockerfile-linux.template @@ -225,6 +225,16 @@ RUN set -eux; \ make \ pkg-config \ ; \ +# go depends on "gold" explicitly on arm64 +# https://github.com/docker-library/golang/issues/570 (go depends on "gold" explicitly on arm64) +# https://github.com/golang/go/issues/22040 +# ... and as of trixie, "gold" is removed from the "binutils" package: +# > WARNING: gold is being removed from binutils, and is deprecated upstream. +# (and available as "binutils-gold" which is also a virtual on bookworm so we can reasonably be explicit everywhere) + dpkgArch="$(dpkg --print-architecture)"; \ + if [ "$dpkgArch" = 'arm64' ]; then \ + apt-get install -y --no-install-recommends binutils-gold; \ + fi; \ rm -rf /var/lib/apt/lists/* {{ ) end -}} diff --git a/tip/bookworm/Dockerfile b/tip/bookworm/Dockerfile index b4ba6f76..54075630 100644 --- a/tip/bookworm/Dockerfile +++ b/tip/bookworm/Dockerfile @@ -119,6 +119,16 @@ RUN set -eux; \ make \ pkg-config \ ; \ +# go depends on "gold" explicitly on arm64 +# https://github.com/docker-library/golang/issues/570 (go depends on "gold" explicitly on arm64) +# https://github.com/golang/go/issues/22040 +# ... and as of trixie, "gold" is removed from the "binutils" package: +# > WARNING: gold is being removed from binutils, and is deprecated upstream. +# (and available as "binutils-gold" which is also a virtual on bookworm so we can reasonably be explicit everywhere) + dpkgArch="$(dpkg --print-architecture)"; \ + if [ "$dpkgArch" = 'arm64' ]; then \ + apt-get install -y --no-install-recommends binutils-gold; \ + fi; \ rm -rf /var/lib/apt/lists/* # don't auto-upgrade the gotoolchain diff --git a/tip/trixie/Dockerfile b/tip/trixie/Dockerfile index 5c3f9c05..a5e156c7 100644 --- a/tip/trixie/Dockerfile +++ b/tip/trixie/Dockerfile @@ -119,6 +119,16 @@ RUN set -eux; \ make \ pkg-config \ ; \ +# go depends on "gold" explicitly on arm64 +# https://github.com/docker-library/golang/issues/570 (go depends on "gold" explicitly on arm64) +# https://github.com/golang/go/issues/22040 +# ... and as of trixie, "gold" is removed from the "binutils" package: +# > WARNING: gold is being removed from binutils, and is deprecated upstream. +# (and available as "binutils-gold" which is also a virtual on bookworm so we can reasonably be explicit everywhere) + dpkgArch="$(dpkg --print-architecture)"; \ + if [ "$dpkgArch" = 'arm64' ]; then \ + apt-get install -y --no-install-recommends binutils-gold; \ + fi; \ rm -rf /var/lib/apt/lists/* # don't auto-upgrade the gotoolchain