Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update golang #15945

Merged
merged 1 commit into from
Dec 20, 2023
Merged

Update golang #15945

merged 1 commit into from
Dec 20, 2023

Conversation

yosifkit
Copy link
Member

Changes:

Changes:

- docker-library/golang@fc56cbc: Merge pull request docker-library/golang#500 from infosiftr/go1.22rc1
- docker-library/golang@8188fe4: Stop (ever) building from source for 1.21+
- docker-library/golang@46d44c1: Add 1.22rc1
- docker-library/golang@3a0fd1f: Update GHA YAML with bashbrew example improvements (esp. concurrency:)
- docker-library/golang@020b04e: Update "munge.sh" (we need to force build on Alpine now and Buster does not exist)
Copy link

Diff for 793c4ab:
diff --git a/_bashbrew-cat b/_bashbrew-cat
index 9629d42..a1ffdca 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -3,12 +3,12 @@ GitRepo: https://github.com/docker-library/golang.git
 
 Tags: 1.20.12-alpine3.18, 1.20-alpine3.18
 Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 339da23255a9dc00f7921fca9a022f6b95843358
+GitCommit: 8188fe464dc344c8ac20cad12cf80e65f452af93
 Directory: 1.20/alpine3.18
 
 Tags: 1.20.12-alpine3.19, 1.20-alpine3.19, 1.20.12-alpine, 1.20-alpine
 Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 84f47a944aa3d10104ad45dd8a188b878595cac4
+GitCommit: 8188fe464dc344c8ac20cad12cf80e65f452af93
 Directory: 1.20/alpine3.19
 
 Tags: 1.20.12-bookworm, 1.20-bookworm
@@ -52,23 +52,23 @@ Constraints: windowsservercore-ltsc2022
 
 Tags: 1.21.5-alpine3.18, 1.21-alpine3.18, 1-alpine3.18, alpine3.18
 Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 40db26d6cc395e12ec499d7d88c77ee5f6dbe912
+GitCommit: 8188fe464dc344c8ac20cad12cf80e65f452af93
 Directory: 1.21/alpine3.18
 
 Tags: 1.21.5-alpine3.19, 1.21-alpine3.19, 1-alpine3.19, alpine3.19, 1.21.5-alpine, 1.21-alpine, 1-alpine, alpine
 Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: 40db26d6cc395e12ec499d7d88c77ee5f6dbe912
+GitCommit: 8188fe464dc344c8ac20cad12cf80e65f452af93
 Directory: 1.21/alpine3.19
 
 Tags: 1.21.5-bookworm, 1.21-bookworm, 1-bookworm, bookworm
 SharedTags: 1.21.5, 1.21, 1, latest
-Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: 40db26d6cc395e12ec499d7d88c77ee5f6dbe912
+Architectures: amd64, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
+GitCommit: 8188fe464dc344c8ac20cad12cf80e65f452af93
 Directory: 1.21/bookworm
 
 Tags: 1.21.5-bullseye, 1.21-bullseye, 1-bullseye, bullseye
-Architectures: amd64, arm32v5, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
-GitCommit: 40db26d6cc395e12ec499d7d88c77ee5f6dbe912
+Architectures: amd64, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
+GitCommit: 8188fe464dc344c8ac20cad12cf80e65f452af93
 Directory: 1.21/bullseye
 
 Tags: 1.21.5-nanoserver-1809, 1.21-nanoserver-1809, 1-nanoserver-1809, nanoserver-1809
@@ -98,3 +98,52 @@ Architectures: windows-amd64
 GitCommit: d106c8658abc0975bcd2d8a68a8f4ca85b04a93a
 Directory: 1.21/windows/windowsservercore-ltsc2022
 Constraints: windowsservercore-ltsc2022
+
+Tags: 1.22rc1-alpine3.18, 1.22-rc-alpine3.18
+Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
+GitCommit: 8188fe464dc344c8ac20cad12cf80e65f452af93
+Directory: 1.22-rc/alpine3.18
+
+Tags: 1.22rc1-alpine3.19, 1.22-rc-alpine3.19, 1.22rc1-alpine, 1.22-rc-alpine
+Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
+GitCommit: 8188fe464dc344c8ac20cad12cf80e65f452af93
+Directory: 1.22-rc/alpine3.19
+
+Tags: 1.22rc1-bookworm, 1.22-rc-bookworm
+SharedTags: 1.22rc1, 1.22-rc
+Architectures: amd64, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
+GitCommit: 8188fe464dc344c8ac20cad12cf80e65f452af93
+Directory: 1.22-rc/bookworm
+
+Tags: 1.22rc1-bullseye, 1.22-rc-bullseye
+Architectures: amd64, arm32v7, arm64v8, i386, mips64le, ppc64le, s390x
+GitCommit: 8188fe464dc344c8ac20cad12cf80e65f452af93
+Directory: 1.22-rc/bullseye
+
+Tags: 1.22rc1-nanoserver-1809, 1.22-rc-nanoserver-1809
+SharedTags: 1.22rc1-nanoserver, 1.22-rc-nanoserver
+Architectures: windows-amd64
+GitCommit: 46d44c197aa3ce81c16ad43a2e4b331cc188053a
+Directory: 1.22-rc/windows/nanoserver-1809
+Constraints: nanoserver-1809, windowsservercore-1809
+
+Tags: 1.22rc1-nanoserver-ltsc2022, 1.22-rc-nanoserver-ltsc2022
+SharedTags: 1.22rc1-nanoserver, 1.22-rc-nanoserver
+Architectures: windows-amd64
+GitCommit: 46d44c197aa3ce81c16ad43a2e4b331cc188053a
+Directory: 1.22-rc/windows/nanoserver-ltsc2022
+Constraints: nanoserver-ltsc2022, windowsservercore-ltsc2022
+
+Tags: 1.22rc1-windowsservercore-1809, 1.22-rc-windowsservercore-1809
+SharedTags: 1.22rc1-windowsservercore, 1.22-rc-windowsservercore, 1.22rc1, 1.22-rc
+Architectures: windows-amd64
+GitCommit: 46d44c197aa3ce81c16ad43a2e4b331cc188053a
+Directory: 1.22-rc/windows/windowsservercore-1809
+Constraints: windowsservercore-1809
+
+Tags: 1.22rc1-windowsservercore-ltsc2022, 1.22-rc-windowsservercore-ltsc2022
+SharedTags: 1.22rc1-windowsservercore, 1.22-rc-windowsservercore, 1.22rc1, 1.22-rc
+Architectures: windows-amd64
+GitCommit: 46d44c197aa3ce81c16ad43a2e4b331cc188053a
+Directory: 1.22-rc/windows/windowsservercore-ltsc2022
+Constraints: windowsservercore-ltsc2022
diff --git a/_bashbrew-list b/_bashbrew-list
index 410eb57..659b431 100644
--- a/_bashbrew-list
+++ b/_bashbrew-list
@@ -58,6 +58,30 @@ golang:1.21.5-nanoserver-ltsc2022
 golang:1.21.5-windowsservercore
 golang:1.21.5-windowsservercore-1809
 golang:1.21.5-windowsservercore-ltsc2022
+golang:1.22rc1
+golang:1.22rc1-alpine
+golang:1.22rc1-alpine3.18
+golang:1.22rc1-alpine3.19
+golang:1.22rc1-bookworm
+golang:1.22rc1-bullseye
+golang:1.22rc1-nanoserver
+golang:1.22rc1-nanoserver-1809
+golang:1.22rc1-nanoserver-ltsc2022
+golang:1.22rc1-windowsservercore
+golang:1.22rc1-windowsservercore-1809
+golang:1.22rc1-windowsservercore-ltsc2022
+golang:1.22-rc
+golang:1.22-rc-alpine
+golang:1.22-rc-alpine3.18
+golang:1.22-rc-alpine3.19
+golang:1.22-rc-bookworm
+golang:1.22-rc-bullseye
+golang:1.22-rc-nanoserver
+golang:1.22-rc-nanoserver-1809
+golang:1.22-rc-nanoserver-ltsc2022
+golang:1.22-rc-windowsservercore
+golang:1.22-rc-windowsservercore-1809
+golang:1.22-rc-windowsservercore-ltsc2022
 golang:alpine
 golang:alpine3.18
 golang:alpine3.19
diff --git a/golang_1.20-alpine/Dockerfile b/golang_1.20-alpine/Dockerfile
index 91e76af..ddd80a5 100644
--- a/golang_1.20-alpine/Dockerfile
+++ b/golang_1.20-alpine/Dockerfile
@@ -49,7 +49,7 @@ RUN set -eux; \
 		build=1; \
 		url='https://dl.google.com/go/go1.20.12.src.tar.gz'; \
 		sha256='c5bf934751d31c315c1d0bb5fb02296545fa6d08923566f7a5afec81f2ed27d6'; \
-# the precompiled binaries published by Go upstream are not compatible with Alpine, so we always build from source here 😅
+# the precompiled binaries published by Go upstream were not compatible with Alpine in Go 1.20, so we always build from source here 😅
 	fi; \
 	\
 	wget -O go.tgz.asc "$url.asc"; \
diff --git a/golang_1.20-alpine3.18/Dockerfile b/golang_1.20-alpine3.18/Dockerfile
index 07d9ef5..99d892d 100644
--- a/golang_1.20-alpine3.18/Dockerfile
+++ b/golang_1.20-alpine3.18/Dockerfile
@@ -49,7 +49,7 @@ RUN set -eux; \
 		build=1; \
 		url='https://dl.google.com/go/go1.20.12.src.tar.gz'; \
 		sha256='c5bf934751d31c315c1d0bb5fb02296545fa6d08923566f7a5afec81f2ed27d6'; \
-# the precompiled binaries published by Go upstream are not compatible with Alpine, so we always build from source here 😅
+# the precompiled binaries published by Go upstream were not compatible with Alpine in Go 1.20, so we always build from source here 😅
 	fi; \
 	\
 	wget -O go.tgz.asc "$url.asc"; \
diff --git a/golang_1.20-alpine/Dockerfile b/golang_1.22-rc-alpine/Dockerfile
similarity index 47%
copy from golang_1.20-alpine/Dockerfile
copy to golang_1.22-rc-alpine/Dockerfile
index 91e76af..f9049f8 100644
--- a/golang_1.20-alpine/Dockerfile
+++ b/golang_1.22-rc-alpine/Dockerfile
@@ -10,7 +10,7 @@ RUN apk add --no-cache ca-certificates
 
 ENV PATH /usr/local/go/bin:$PATH
 
-ENV GOLANG_VERSION 1.20.12
+ENV GOLANG_VERSION 1.22rc1
 
 RUN set -eux; \
 	apk add --no-cache --virtual .fetch-deps gnupg; \
@@ -18,39 +18,39 @@ RUN set -eux; \
 	url=; \
 	case "$arch" in \
 		'x86_64') \
-			export GOAMD64='v1' GOARCH='amd64' GOOS='linux'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-amd64.tar.gz'; \
+			sha256='fbe9d0585b9322d44008f6baf78b391b22f64294338c6ce2b9eb6040d6373c52'; \
 			;; \
 		'armhf') \
-			export GOARCH='arm' GOARM='6' GOOS='linux'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-armv6l.tar.gz'; \
+			sha256='78e86eb1f449d88692829f1d794cd9f696b66c4f5e25f4ceb4ddd3ad7bee3683'; \
 			;; \
 		'armv7') \
-			export GOARCH='arm' GOARM='7' GOOS='linux'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-armv6l.tar.gz'; \
+			sha256='78e86eb1f449d88692829f1d794cd9f696b66c4f5e25f4ceb4ddd3ad7bee3683'; \
 			;; \
 		'aarch64') \
-			export GOARCH='arm64' GOOS='linux'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-arm64.tar.gz'; \
+			sha256='d777d6bc3241bcd470603c3af896d1c60ed1d8cc718cf92d0a5d9035b149a827'; \
 			;; \
 		'x86') \
-			export GO386='softfloat' GOARCH='386' GOOS='linux'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-386.tar.gz'; \
+			sha256='85ea68ef2fbd0d28179a8852401f498cb02dd7a2d688e71e54ee6180a790d105'; \
 			;; \
 		'ppc64le') \
-			export GOARCH='ppc64le' GOOS='linux'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-ppc64le.tar.gz'; \
+			sha256='051d68e1fb9c804db0c5ecf856493ccf7611f6b05424bfe6d6a03ce03e5dbb24'; \
 			;; \
 		'riscv64') \
-			export GOARCH='riscv64' GOOS='linux'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-riscv64.tar.gz'; \
+			sha256='f7c9d98683f52004bc9942a6ac4ae628f89070446f24ad5451404ad7ee27682a'; \
 			;; \
 		's390x') \
-			export GOARCH='s390x' GOOS='linux'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-s390x.tar.gz'; \
+			sha256='29e6b990a47cb3942e72208e91e370b3620119d0a7dcb2a58de57bde7716fc2b'; \
 			;; \
 		*) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \
 	esac; \
-	build=; \
-	if [ -z "$url" ]; then \
-# https://github.com/golang/go/issues/38536#issuecomment-616897960
-		build=1; \
-		url='https://dl.google.com/go/go1.20.12.src.tar.gz'; \
-		sha256='c5bf934751d31c315c1d0bb5fb02296545fa6d08923566f7a5afec81f2ed27d6'; \
-# the precompiled binaries published by Go upstream are not compatible with Alpine, so we always build from source here 😅
-	fi; \
 	\
 	wget -O go.tgz.asc "$url.asc"; \
 	wget -O go.tgz "$url"; \
@@ -69,45 +69,14 @@ RUN set -eux; \
 	tar -C /usr/local -xzf go.tgz; \
 	rm go.tgz; \
 	\
-	if [ -n "$build" ]; then \
-		apk add --no-cache --virtual .build-deps \
-			bash \
-			gcc \
-			go \
-			musl-dev \
-		; \
-		\
-		export GOCACHE='/tmp/gocache'; \
-		\
-		( \
-			cd /usr/local/go/src; \
-# set GOROOT_BOOTSTRAP + GOHOST* such that we can build Go successfully
-			export GOROOT_BOOTSTRAP="$(go env GOROOT)" GOHOSTOS="$GOOS" GOHOSTARCH="$GOARCH"; \
-			if [ "${GOARCH:-}" = '386' ]; then \
-# https://github.com/golang/go/issues/52919; https://github.com/docker-library/golang/pull/426#issuecomment-1152623837
-				export CGO_CFLAGS='-fno-stack-protector'; \
-			fi; \
-			./make.bash; \
-		); \
-		\
-		apk del --no-network .build-deps; \
-		\
-# remove a few intermediate / bootstrapping files the official binary release tarballs do not contain
-		rm -rf \
-			/usr/local/go/pkg/*/cmd \
-			/usr/local/go/pkg/bootstrap \
-			/usr/local/go/pkg/obj \
-			/usr/local/go/pkg/tool/*/api \
-			/usr/local/go/pkg/tool/*/go_bootstrap \
-			/usr/local/go/src/cmd/dist/dist \
-			"$GOCACHE" \
-		; \
-	fi; \
-	\
 	apk del --no-network .fetch-deps; \
 	\
 	go version
 
+# don't auto-upgrade the gotoolchain
+# https://github.com/docker-library/golang/issues/472
+ENV GOTOOLCHAIN=local
+
 ENV GOPATH /go
 ENV PATH $GOPATH/bin:$PATH
 RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH"
diff --git a/golang_1.20-alpine3.18/Dockerfile b/golang_1.22-rc-alpine3.18/Dockerfile
similarity index 47%
copy from golang_1.20-alpine3.18/Dockerfile
copy to golang_1.22-rc-alpine3.18/Dockerfile
index 07d9ef5..81c5407 100644
--- a/golang_1.20-alpine3.18/Dockerfile
+++ b/golang_1.22-rc-alpine3.18/Dockerfile
@@ -10,7 +10,7 @@ RUN apk add --no-cache ca-certificates
 
 ENV PATH /usr/local/go/bin:$PATH
 
-ENV GOLANG_VERSION 1.20.12
+ENV GOLANG_VERSION 1.22rc1
 
 RUN set -eux; \
 	apk add --no-cache --virtual .fetch-deps gnupg; \
@@ -18,39 +18,39 @@ RUN set -eux; \
 	url=; \
 	case "$arch" in \
 		'x86_64') \
-			export GOAMD64='v1' GOARCH='amd64' GOOS='linux'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-amd64.tar.gz'; \
+			sha256='fbe9d0585b9322d44008f6baf78b391b22f64294338c6ce2b9eb6040d6373c52'; \
 			;; \
 		'armhf') \
-			export GOARCH='arm' GOARM='6' GOOS='linux'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-armv6l.tar.gz'; \
+			sha256='78e86eb1f449d88692829f1d794cd9f696b66c4f5e25f4ceb4ddd3ad7bee3683'; \
 			;; \
 		'armv7') \
-			export GOARCH='arm' GOARM='7' GOOS='linux'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-armv6l.tar.gz'; \
+			sha256='78e86eb1f449d88692829f1d794cd9f696b66c4f5e25f4ceb4ddd3ad7bee3683'; \
 			;; \
 		'aarch64') \
-			export GOARCH='arm64' GOOS='linux'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-arm64.tar.gz'; \
+			sha256='d777d6bc3241bcd470603c3af896d1c60ed1d8cc718cf92d0a5d9035b149a827'; \
 			;; \
 		'x86') \
-			export GO386='softfloat' GOARCH='386' GOOS='linux'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-386.tar.gz'; \
+			sha256='85ea68ef2fbd0d28179a8852401f498cb02dd7a2d688e71e54ee6180a790d105'; \
 			;; \
 		'ppc64le') \
-			export GOARCH='ppc64le' GOOS='linux'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-ppc64le.tar.gz'; \
+			sha256='051d68e1fb9c804db0c5ecf856493ccf7611f6b05424bfe6d6a03ce03e5dbb24'; \
 			;; \
 		'riscv64') \
-			export GOARCH='riscv64' GOOS='linux'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-riscv64.tar.gz'; \
+			sha256='f7c9d98683f52004bc9942a6ac4ae628f89070446f24ad5451404ad7ee27682a'; \
 			;; \
 		's390x') \
-			export GOARCH='s390x' GOOS='linux'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-s390x.tar.gz'; \
+			sha256='29e6b990a47cb3942e72208e91e370b3620119d0a7dcb2a58de57bde7716fc2b'; \
 			;; \
 		*) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \
 	esac; \
-	build=; \
-	if [ -z "$url" ]; then \
-# https://github.com/golang/go/issues/38536#issuecomment-616897960
-		build=1; \
-		url='https://dl.google.com/go/go1.20.12.src.tar.gz'; \
-		sha256='c5bf934751d31c315c1d0bb5fb02296545fa6d08923566f7a5afec81f2ed27d6'; \
-# the precompiled binaries published by Go upstream are not compatible with Alpine, so we always build from source here 😅
-	fi; \
 	\
 	wget -O go.tgz.asc "$url.asc"; \
 	wget -O go.tgz "$url"; \
@@ -69,45 +69,14 @@ RUN set -eux; \
 	tar -C /usr/local -xzf go.tgz; \
 	rm go.tgz; \
 	\
-	if [ -n "$build" ]; then \
-		apk add --no-cache --virtual .build-deps \
-			bash \
-			gcc \
-			go \
-			musl-dev \
-		; \
-		\
-		export GOCACHE='/tmp/gocache'; \
-		\
-		( \
-			cd /usr/local/go/src; \
-# set GOROOT_BOOTSTRAP + GOHOST* such that we can build Go successfully
-			export GOROOT_BOOTSTRAP="$(go env GOROOT)" GOHOSTOS="$GOOS" GOHOSTARCH="$GOARCH"; \
-			if [ "${GOARCH:-}" = '386' ]; then \
-# https://github.com/golang/go/issues/52919; https://github.com/docker-library/golang/pull/426#issuecomment-1152623837
-				export CGO_CFLAGS='-fno-stack-protector'; \
-			fi; \
-			./make.bash; \
-		); \
-		\
-		apk del --no-network .build-deps; \
-		\
-# remove a few intermediate / bootstrapping files the official binary release tarballs do not contain
-		rm -rf \
-			/usr/local/go/pkg/*/cmd \
-			/usr/local/go/pkg/bootstrap \
-			/usr/local/go/pkg/obj \
-			/usr/local/go/pkg/tool/*/api \
-			/usr/local/go/pkg/tool/*/go_bootstrap \
-			/usr/local/go/src/cmd/dist/dist \
-			"$GOCACHE" \
-		; \
-	fi; \
-	\
 	apk del --no-network .fetch-deps; \
 	\
 	go version
 
+# don't auto-upgrade the gotoolchain
+# https://github.com/docker-library/golang/issues/472
+ENV GOTOOLCHAIN=local
+
 ENV GOPATH /go
 ENV PATH $GOPATH/bin:$PATH
 RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH"
diff --git a/golang_1.20-bookworm/Dockerfile b/golang_1.22-rc-bookworm/Dockerfile
similarity index 41%
copy from golang_1.20-bookworm/Dockerfile
copy to golang_1.22-rc-bookworm/Dockerfile
index 0fcb53d..e10376a 100644
--- a/golang_1.20-bookworm/Dockerfile
+++ b/golang_1.22-rc-bookworm/Dockerfile
@@ -20,57 +20,46 @@ RUN set -eux; \
 
 ENV PATH /usr/local/go/bin:$PATH
 
-ENV GOLANG_VERSION 1.20.12
+ENV GOLANG_VERSION 1.22rc1
 
 RUN set -eux; \
 	arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \
 	url=; \
 	case "$arch" in \
 		'amd64') \
-			url='https://dl.google.com/go/go1.20.12.linux-amd64.tar.gz'; \
-			sha256='9c5d48c54dd8b0a3b2ef91b0f92a1190aa01f11d26e98033efa64c46a30bba7b'; \
-			;; \
-		'armel') \
-			export GOARCH='arm' GOARM='5' GOOS='linux'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-amd64.tar.gz'; \
+			sha256='fbe9d0585b9322d44008f6baf78b391b22f64294338c6ce2b9eb6040d6373c52'; \
 			;; \
 		'armhf') \
-			url='https://dl.google.com/go/go1.20.12.linux-armv6l.tar.gz'; \
-			sha256='bf4687cbbf0c44a82311d52e2dcccb263f3d9c3b512007e1fae569e03dc0a189'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-armv6l.tar.gz'; \
+			sha256='78e86eb1f449d88692829f1d794cd9f696b66c4f5e25f4ceb4ddd3ad7bee3683'; \
 			;; \
 		'arm64') \
-			url='https://dl.google.com/go/go1.20.12.linux-arm64.tar.gz'; \
-			sha256='8afe8e3fb6972eaa2179ef0a71678c67f26509fab4f0f67c4b00f4cdfa92dc87'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-arm64.tar.gz'; \
+			sha256='d777d6bc3241bcd470603c3af896d1c60ed1d8cc718cf92d0a5d9035b149a827'; \
 			;; \
 		'i386') \
-			url='https://dl.google.com/go/go1.20.12.linux-386.tar.gz'; \
-			sha256='77db17c6350448b0c3afa5c4248426d8a445b5e8ac2411fff57463b47f8d7f80'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-386.tar.gz'; \
+			sha256='85ea68ef2fbd0d28179a8852401f498cb02dd7a2d688e71e54ee6180a790d105'; \
 			;; \
 		'mips64el') \
-			export GOARCH='mips64le' GOOS='linux'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-mips64le.tar.gz'; \
+			sha256='c424d3145bb770b5fc04e0b2316cbb9be34724ba66e83c83659830835ef698f9'; \
 			;; \
 		'ppc64el') \
-			url='https://dl.google.com/go/go1.20.12.linux-ppc64le.tar.gz'; \
-			sha256='2ae0ec3736216dfbd7b01ff679842dc1bed365e53a024d522645bcffd01c7328'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-ppc64le.tar.gz'; \
+			sha256='051d68e1fb9c804db0c5ecf856493ccf7611f6b05424bfe6d6a03ce03e5dbb24'; \
 			;; \
 		'riscv64') \
-			export GOARCH='riscv64' GOOS='linux'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-riscv64.tar.gz'; \
+			sha256='f7c9d98683f52004bc9942a6ac4ae628f89070446f24ad5451404ad7ee27682a'; \
 			;; \
 		's390x') \
-			url='https://dl.google.com/go/go1.20.12.linux-s390x.tar.gz'; \
-			sha256='ee48b23e1978a866cb60a8e8ddf0bd61cbbaf86bcfcdbf4f9509f34e9159ce45'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-s390x.tar.gz'; \
+			sha256='29e6b990a47cb3942e72208e91e370b3620119d0a7dcb2a58de57bde7716fc2b'; \
 			;; \
 		*) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \
 	esac; \
-	build=; \
-	if [ -z "$url" ]; then \
-# https://github.com/golang/go/issues/38536#issuecomment-616897960
-		build=1; \
-		url='https://dl.google.com/go/go1.20.12.src.tar.gz'; \
-		sha256='c5bf934751d31c315c1d0bb5fb02296545fa6d08923566f7a5afec81f2ed27d6'; \
-		echo >&2; \
-		echo >&2 "warning: current architecture ($arch) does not have a compatible Go binary release; will be building from source"; \
-		echo >&2; \
-	fi; \
 	\
 	wget -O go.tgz.asc "$url.asc"; \
 	wget -O go.tgz "$url" --progress=dot:giga; \
@@ -89,39 +78,12 @@ RUN set -eux; \
 	tar -C /usr/local -xzf go.tgz; \
 	rm go.tgz; \
 	\
-	if [ -n "$build" ]; then \
-		savedAptMark="$(apt-mark showmanual)"; \
-		apt-get update; \
-		apt-get install -y --no-install-recommends golang-go; \
-		\
-		export GOCACHE='/tmp/gocache'; \
-		\
-		( \
-			cd /usr/local/go/src; \
-# set GOROOT_BOOTSTRAP + GOHOST* such that we can build Go successfully
-			export GOROOT_BOOTSTRAP="$(go env GOROOT)" GOHOSTOS="$GOOS" GOHOSTARCH="$GOARCH"; \
-			./make.bash; \
-		); \
-		\
-		apt-mark auto '.*' > /dev/null; \
-		apt-mark manual $savedAptMark > /dev/null; \
-		apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
-		rm -rf /var/lib/apt/lists/*; \
-		\
-# remove a few intermediate / bootstrapping files the official binary release tarballs do not contain
-		rm -rf \
-			/usr/local/go/pkg/*/cmd \
-			/usr/local/go/pkg/bootstrap \
-			/usr/local/go/pkg/obj \
-			/usr/local/go/pkg/tool/*/api \
-			/usr/local/go/pkg/tool/*/go_bootstrap \
-			/usr/local/go/src/cmd/dist/dist \
-			"$GOCACHE" \
-		; \
-	fi; \
-	\
 	go version
 
+# don't auto-upgrade the gotoolchain
+# https://github.com/docker-library/golang/issues/472
+ENV GOTOOLCHAIN=local
+
 ENV GOPATH /go
 ENV PATH $GOPATH/bin:$PATH
 RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH"
diff --git a/golang_1.20-bookworm/Dockerfile b/golang_1.22-rc-bullseye/Dockerfile
similarity index 40%
copy from golang_1.20-bookworm/Dockerfile
copy to golang_1.22-rc-bullseye/Dockerfile
index 0fcb53d..f25a8ac 100644
--- a/golang_1.20-bookworm/Dockerfile
+++ b/golang_1.22-rc-bullseye/Dockerfile
@@ -4,7 +4,7 @@
 # PLEASE DO NOT EDIT IT DIRECTLY.
 #
 
-FROM buildpack-deps:bookworm-scm
+FROM buildpack-deps:bullseye-scm
 
 # install cgo-related dependencies
 RUN set -eux; \
@@ -20,57 +20,46 @@ RUN set -eux; \
 
 ENV PATH /usr/local/go/bin:$PATH
 
-ENV GOLANG_VERSION 1.20.12
+ENV GOLANG_VERSION 1.22rc1
 
 RUN set -eux; \
 	arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \
 	url=; \
 	case "$arch" in \
 		'amd64') \
-			url='https://dl.google.com/go/go1.20.12.linux-amd64.tar.gz'; \
-			sha256='9c5d48c54dd8b0a3b2ef91b0f92a1190aa01f11d26e98033efa64c46a30bba7b'; \
-			;; \
-		'armel') \
-			export GOARCH='arm' GOARM='5' GOOS='linux'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-amd64.tar.gz'; \
+			sha256='fbe9d0585b9322d44008f6baf78b391b22f64294338c6ce2b9eb6040d6373c52'; \
 			;; \
 		'armhf') \
-			url='https://dl.google.com/go/go1.20.12.linux-armv6l.tar.gz'; \
-			sha256='bf4687cbbf0c44a82311d52e2dcccb263f3d9c3b512007e1fae569e03dc0a189'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-armv6l.tar.gz'; \
+			sha256='78e86eb1f449d88692829f1d794cd9f696b66c4f5e25f4ceb4ddd3ad7bee3683'; \
 			;; \
 		'arm64') \
-			url='https://dl.google.com/go/go1.20.12.linux-arm64.tar.gz'; \
-			sha256='8afe8e3fb6972eaa2179ef0a71678c67f26509fab4f0f67c4b00f4cdfa92dc87'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-arm64.tar.gz'; \
+			sha256='d777d6bc3241bcd470603c3af896d1c60ed1d8cc718cf92d0a5d9035b149a827'; \
 			;; \
 		'i386') \
-			url='https://dl.google.com/go/go1.20.12.linux-386.tar.gz'; \
-			sha256='77db17c6350448b0c3afa5c4248426d8a445b5e8ac2411fff57463b47f8d7f80'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-386.tar.gz'; \
+			sha256='85ea68ef2fbd0d28179a8852401f498cb02dd7a2d688e71e54ee6180a790d105'; \
 			;; \
 		'mips64el') \
-			export GOARCH='mips64le' GOOS='linux'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-mips64le.tar.gz'; \
+			sha256='c424d3145bb770b5fc04e0b2316cbb9be34724ba66e83c83659830835ef698f9'; \
 			;; \
 		'ppc64el') \
-			url='https://dl.google.com/go/go1.20.12.linux-ppc64le.tar.gz'; \
-			sha256='2ae0ec3736216dfbd7b01ff679842dc1bed365e53a024d522645bcffd01c7328'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-ppc64le.tar.gz'; \
+			sha256='051d68e1fb9c804db0c5ecf856493ccf7611f6b05424bfe6d6a03ce03e5dbb24'; \
 			;; \
 		'riscv64') \
-			export GOARCH='riscv64' GOOS='linux'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-riscv64.tar.gz'; \
+			sha256='f7c9d98683f52004bc9942a6ac4ae628f89070446f24ad5451404ad7ee27682a'; \
 			;; \
 		's390x') \
-			url='https://dl.google.com/go/go1.20.12.linux-s390x.tar.gz'; \
-			sha256='ee48b23e1978a866cb60a8e8ddf0bd61cbbaf86bcfcdbf4f9509f34e9159ce45'; \
+			url='https://dl.google.com/go/go1.22rc1.linux-s390x.tar.gz'; \
+			sha256='29e6b990a47cb3942e72208e91e370b3620119d0a7dcb2a58de57bde7716fc2b'; \
 			;; \
 		*) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \
 	esac; \
-	build=; \
-	if [ -z "$url" ]; then \
-# https://github.com/golang/go/issues/38536#issuecomment-616897960
-		build=1; \
-		url='https://dl.google.com/go/go1.20.12.src.tar.gz'; \
-		sha256='c5bf934751d31c315c1d0bb5fb02296545fa6d08923566f7a5afec81f2ed27d6'; \
-		echo >&2; \
-		echo >&2 "warning: current architecture ($arch) does not have a compatible Go binary release; will be building from source"; \
-		echo >&2; \
-	fi; \
 	\
 	wget -O go.tgz.asc "$url.asc"; \
 	wget -O go.tgz "$url" --progress=dot:giga; \
@@ -89,39 +78,12 @@ RUN set -eux; \
 	tar -C /usr/local -xzf go.tgz; \
 	rm go.tgz; \
 	\
-	if [ -n "$build" ]; then \
-		savedAptMark="$(apt-mark showmanual)"; \
-		apt-get update; \
-		apt-get install -y --no-install-recommends golang-go; \
-		\
-		export GOCACHE='/tmp/gocache'; \
-		\
-		( \
-			cd /usr/local/go/src; \
-# set GOROOT_BOOTSTRAP + GOHOST* such that we can build Go successfully
-			export GOROOT_BOOTSTRAP="$(go env GOROOT)" GOHOSTOS="$GOOS" GOHOSTARCH="$GOARCH"; \
-			./make.bash; \
-		); \
-		\
-		apt-mark auto '.*' > /dev/null; \
-		apt-mark manual $savedAptMark > /dev/null; \
-		apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
-		rm -rf /var/lib/apt/lists/*; \
-		\
-# remove a few intermediate / bootstrapping files the official binary release tarballs do not contain
-		rm -rf \
-			/usr/local/go/pkg/*/cmd \
-			/usr/local/go/pkg/bootstrap \
-			/usr/local/go/pkg/obj \
-			/usr/local/go/pkg/tool/*/api \
-			/usr/local/go/pkg/tool/*/go_bootstrap \
-			/usr/local/go/src/cmd/dist/dist \
-			"$GOCACHE" \
-		; \
-	fi; \
-	\
 	go version
 
+# don't auto-upgrade the gotoolchain
+# https://github.com/docker-library/golang/issues/472
+ENV GOTOOLCHAIN=local
+
 ENV GOPATH /go
 ENV PATH $GOPATH/bin:$PATH
 RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH"
diff --git a/golang_1.20-nanoserver-1809/Dockerfile b/golang_1.22-rc-nanoserver-1809/Dockerfile
similarity index 92%
copy from golang_1.20-nanoserver-1809/Dockerfile
copy to golang_1.22-rc-nanoserver-1809/Dockerfile
index 0cca7fa..2a7e863 100644
--- a/golang_1.20-nanoserver-1809/Dockerfile
+++ b/golang_1.22-rc-nanoserver-1809/Dockerfile
@@ -21,10 +21,10 @@ RUN setx /m PATH "%GOPATH%\bin;C:\Program Files\Go\bin;%PATH%"
 USER ContainerUser
 # doing this first to share cache across versions more aggressively
 
-ENV GOLANG_VERSION 1.20.12
+ENV GOLANG_VERSION 1.22rc1
 
 # Docker's Windows path parsing is absolutely *cursed*; please just trust me on this one -Tianon
-COPY --from=golang:1.20.12-windowsservercore-1809 ["C:\\\\Program Files\\\\Go","C:\\\\Program Files\\\\Go"]
+COPY --from=golang:1.22rc1-windowsservercore-1809 ["C:\\\\Program Files\\\\Go","C:\\\\Program Files\\\\Go"]
 RUN go version
 
 WORKDIR $GOPATH
diff --git a/golang_1.20-nanoserver-ltsc2022/Dockerfile b/golang_1.22-rc-nanoserver-ltsc2022/Dockerfile
similarity index 92%
copy from golang_1.20-nanoserver-ltsc2022/Dockerfile
copy to golang_1.22-rc-nanoserver-ltsc2022/Dockerfile
index 53cbd42..fee318b 100644
--- a/golang_1.20-nanoserver-ltsc2022/Dockerfile
+++ b/golang_1.22-rc-nanoserver-ltsc2022/Dockerfile
@@ -21,10 +21,10 @@ RUN setx /m PATH "%GOPATH%\bin;C:\Program Files\Go\bin;%PATH%"
 USER ContainerUser
 # doing this first to share cache across versions more aggressively
 
-ENV GOLANG_VERSION 1.20.12
+ENV GOLANG_VERSION 1.22rc1
 
 # Docker's Windows path parsing is absolutely *cursed*; please just trust me on this one -Tianon
-COPY --from=golang:1.20.12-windowsservercore-ltsc2022 ["C:\\\\Program Files\\\\Go","C:\\\\Program Files\\\\Go"]
+COPY --from=golang:1.22rc1-windowsservercore-ltsc2022 ["C:\\\\Program Files\\\\Go","C:\\\\Program Files\\\\Go"]
 RUN go version
 
 WORKDIR $GOPATH
diff --git a/golang_1.20-windowsservercore-1809/Dockerfile b/golang_1.22-rc-windowsservercore-1809/Dockerfile
similarity index 95%
copy from golang_1.20-windowsservercore-1809/Dockerfile
copy to golang_1.22-rc-windowsservercore-1809/Dockerfile
index cd949bc..38f596d 100644
--- a/golang_1.20-windowsservercore-1809/Dockerfile
+++ b/golang_1.22-rc-windowsservercore-1809/Dockerfile
@@ -53,14 +53,14 @@ RUN $newPath = ('{0}\bin;C:\Program Files\Go\bin;{1}' -f $env:GOPATH, $env:PATH)
 	[Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Machine);
 # doing this first to share cache across versions more aggressively
 
-ENV GOLANG_VERSION 1.20.12
+ENV GOLANG_VERSION 1.22rc1
 
-RUN $url = 'https://dl.google.com/go/go1.20.12.windows-amd64.zip'; \
+RUN $url = 'https://dl.google.com/go/go1.22rc1.windows-amd64.zip'; \
 	Write-Host ('Downloading {0} ...' -f $url); \
 	[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
 	Invoke-WebRequest -Uri $url -OutFile 'go.zip'; \
 	\
-	$sha256 = 'b17e682750f8385c44896cccc4fd3d5289e50a14765b2a72eb389e79e60b3ee7'; \
+	$sha256 = '4aea6071f7a0505d9b99bccd6d5d40dba8d89e8b0c98f77db6c9b9202e2b76bf'; \
 	Write-Host ('Verifying sha256 ({0}) ...' -f $sha256); \
 	if ((Get-FileHash go.zip -Algorithm sha256).Hash -ne $sha256) { \
 		Write-Host 'FAILED!'; \
diff --git a/golang_1.20-windowsservercore-ltsc2022/Dockerfile b/golang_1.22-rc-windowsservercore-ltsc2022/Dockerfile
similarity index 95%
copy from golang_1.20-windowsservercore-ltsc2022/Dockerfile
copy to golang_1.22-rc-windowsservercore-ltsc2022/Dockerfile
index 95c18a2..c279421 100644
--- a/golang_1.20-windowsservercore-ltsc2022/Dockerfile
+++ b/golang_1.22-rc-windowsservercore-ltsc2022/Dockerfile
@@ -53,14 +53,14 @@ RUN $newPath = ('{0}\bin;C:\Program Files\Go\bin;{1}' -f $env:GOPATH, $env:PATH)
 	[Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Machine);
 # doing this first to share cache across versions more aggressively
 
-ENV GOLANG_VERSION 1.20.12
+ENV GOLANG_VERSION 1.22rc1
 
-RUN $url = 'https://dl.google.com/go/go1.20.12.windows-amd64.zip'; \
+RUN $url = 'https://dl.google.com/go/go1.22rc1.windows-amd64.zip'; \
 	Write-Host ('Downloading {0} ...' -f $url); \
 	[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
 	Invoke-WebRequest -Uri $url -OutFile 'go.zip'; \
 	\
-	$sha256 = 'b17e682750f8385c44896cccc4fd3d5289e50a14765b2a72eb389e79e60b3ee7'; \
+	$sha256 = '4aea6071f7a0505d9b99bccd6d5d40dba8d89e8b0c98f77db6c9b9202e2b76bf'; \
 	Write-Host ('Verifying sha256 ({0}) ...' -f $sha256); \
 	if ((Get-FileHash go.zip -Algorithm sha256).Hash -ne $sha256) { \
 		Write-Host 'FAILED!'; \
diff --git a/golang_alpine/Dockerfile b/golang_alpine/Dockerfile
index 44b083f..0670a86 100644
--- a/golang_alpine/Dockerfile
+++ b/golang_alpine/Dockerfile
@@ -51,16 +51,6 @@ RUN set -eux; \
 			;; \
 		*) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \
 	esac; \
-	build=; \
-	if [ -z "$url" ]; then \
-# https://github.com/golang/go/issues/38536#issuecomment-616897960
-		build=1; \
-		url='https://dl.google.com/go/go1.21.5.src.tar.gz'; \
-		sha256='285cbbdf4b6e6e62ed58f370f3f6d8c30825d6e56c5853c66d3c23bcdb09db19'; \
-		echo >&2; \
-		echo >&2 "warning: current architecture ($arch) does not have a compatible Go binary release; will be building from source"; \
-		echo >&2; \
-	fi; \
 	\
 	wget -O go.tgz.asc "$url.asc"; \
 	wget -O go.tgz "$url"; \
@@ -79,50 +69,6 @@ RUN set -eux; \
 	tar -C /usr/local -xzf go.tgz; \
 	rm go.tgz; \
 	\
-	if [ -n "$build" ]; then \
-		apk add --no-cache --virtual .build-deps \
-			bash \
-			gcc \
-			go \
-			musl-dev \
-		; \
-		\
-		export GOCACHE='/tmp/gocache'; \
-		\
-		( \
-			cd /usr/local/go/src; \
-# set GOROOT_BOOTSTRAP + GOHOST* such that we can build Go successfully
-			export GOROOT_BOOTSTRAP="$(go env GOROOT)" GOHOSTOS="$GOOS" GOHOSTARCH="$GOARCH"; \
-			if [ "${GOARCH:-}" = '386' ]; then \
-# https://github.com/golang/go/issues/52919; https://github.com/docker-library/golang/pull/426#issuecomment-1152623837
-				export CGO_CFLAGS='-fno-stack-protector'; \
-			fi; \
-			./make.bash; \
-		); \
-		\
-		apk del --no-network .build-deps; \
-		\
-# remove a few intermediate / bootstrapping files the official binary release tarballs do not contain
-		rm -rf \
-			/usr/local/go/pkg/*/cmd \
-			/usr/local/go/pkg/bootstrap \
-			/usr/local/go/pkg/obj \
-			/usr/local/go/pkg/tool/*/api \
-			/usr/local/go/pkg/tool/*/go_bootstrap \
-			/usr/local/go/src/cmd/dist/dist \
-			"$GOCACHE" \
-		; \
-	elif [ "$arch" = 'armv7' ]; then \
-		[ -s /usr/local/go/go.env ]; \
-		before="$(go env GOARM)"; [ "$before" != '7' ]; \
-		{ \
-			echo; \
-			echo '# https://github.com/docker-library/golang/issues/494'; \
-			echo 'GOARM=7'; \
-		} >> /usr/local/go/go.env; \
-		after="$(go env GOARM)"; [ "$after" = '7' ]; \
-	fi; \
-	\
 	apk del --no-network .fetch-deps; \
 	\
 	go version
diff --git a/golang_alpine3.18/Dockerfile b/golang_alpine3.18/Dockerfile
index 3f3d9f4..675a35a 100644
--- a/golang_alpine3.18/Dockerfile
+++ b/golang_alpine3.18/Dockerfile
@@ -51,16 +51,6 @@ RUN set -eux; \
 			;; \
 		*) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \
 	esac; \
-	build=; \
-	if [ -z "$url" ]; then \
-# https://github.com/golang/go/issues/38536#issuecomment-616897960
-		build=1; \
-		url='https://dl.google.com/go/go1.21.5.src.tar.gz'; \
-		sha256='285cbbdf4b6e6e62ed58f370f3f6d8c30825d6e56c5853c66d3c23bcdb09db19'; \
-		echo >&2; \
-		echo >&2 "warning: current architecture ($arch) does not have a compatible Go binary release; will be building from source"; \
-		echo >&2; \
-	fi; \
 	\
 	wget -O go.tgz.asc "$url.asc"; \
 	wget -O go.tgz "$url"; \
@@ -79,50 +69,6 @@ RUN set -eux; \
 	tar -C /usr/local -xzf go.tgz; \
 	rm go.tgz; \
 	\
-	if [ -n "$build" ]; then \
-		apk add --no-cache --virtual .build-deps \
-			bash \
-			gcc \
-			go \
-			musl-dev \
-		; \
-		\
-		export GOCACHE='/tmp/gocache'; \
-		\
-		( \
-			cd /usr/local/go/src; \
-# set GOROOT_BOOTSTRAP + GOHOST* such that we can build Go successfully
-			export GOROOT_BOOTSTRAP="$(go env GOROOT)" GOHOSTOS="$GOOS" GOHOSTARCH="$GOARCH"; \
-			if [ "${GOARCH:-}" = '386' ]; then \
-# https://github.com/golang/go/issues/52919; https://github.com/docker-library/golang/pull/426#issuecomment-1152623837
-				export CGO_CFLAGS='-fno-stack-protector'; \
-			fi; \
-			./make.bash; \
-		); \
-		\
-		apk del --no-network .build-deps; \
-		\
-# remove a few intermediate / bootstrapping files the official binary release tarballs do not contain
-		rm -rf \
-			/usr/local/go/pkg/*/cmd \
-			/usr/local/go/pkg/bootstrap \
-			/usr/local/go/pkg/obj \
-			/usr/local/go/pkg/tool/*/api \
-			/usr/local/go/pkg/tool/*/go_bootstrap \
-			/usr/local/go/src/cmd/dist/dist \
-			"$GOCACHE" \
-		; \
-	elif [ "$arch" = 'armv7' ]; then \
-		[ -s /usr/local/go/go.env ]; \
-		before="$(go env GOARM)"; [ "$before" != '7' ]; \
-		{ \
-			echo; \
-			echo '# https://github.com/docker-library/golang/issues/494'; \
-			echo 'GOARM=7'; \
-		} >> /usr/local/go/go.env; \
-		after="$(go env GOARM)"; [ "$after" = '7' ]; \
-	fi; \
-	\
 	apk del --no-network .fetch-deps; \
 	\
 	go version
diff --git a/golang_bookworm/Dockerfile b/golang_bookworm/Dockerfile
index def7f93..a08b58c 100644
--- a/golang_bookworm/Dockerfile
+++ b/golang_bookworm/Dockerfile
@@ -30,9 +30,6 @@ RUN set -eux; \
 			url='https://dl.google.com/go/go1.21.5.linux-amd64.tar.gz'; \
 			sha256='e2bc0b3e4b64111ec117295c088bde5f00eeed1567999ff77bc859d7df70078e'; \
 			;; \
-		'armel') \
-			export GOARCH='arm' GOARM='5' GOOS='linux'; \
-			;; \
 		'armhf') \
 			url='https://dl.google.com/go/go1.21.5.linux-armv6l.tar.gz'; \
 			sha256='837f4bf4e22fcdf920ffeaa4abf3d02d1314e03725431065f4d44c46a01b42fe'; \
@@ -63,16 +60,6 @@ RUN set -eux; \
 			;; \
 		*) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \
 	esac; \
-	build=; \
-	if [ -z "$url" ]; then \
-# https://github.com/golang/go/issues/38536#issuecomment-616897960
-		build=1; \
-		url='https://dl.google.com/go/go1.21.5.src.tar.gz'; \
-		sha256='285cbbdf4b6e6e62ed58f370f3f6d8c30825d6e56c5853c66d3c23bcdb09db19'; \
-		echo >&2; \
-		echo >&2 "warning: current architecture ($arch) does not have a compatible Go binary release; will be building from source"; \
-		echo >&2; \
-	fi; \
 	\
 	wget -O go.tgz.asc "$url.asc"; \
 	wget -O go.tgz "$url" --progress=dot:giga; \
@@ -91,46 +78,6 @@ RUN set -eux; \
 	tar -C /usr/local -xzf go.tgz; \
 	rm go.tgz; \
 	\
-	if [ -n "$build" ]; then \
-		savedAptMark="$(apt-mark showmanual)"; \
-		apt-get update; \
-		apt-get install -y --no-install-recommends golang-go; \
-		\
-		export GOCACHE='/tmp/gocache'; \
-		\
-		( \
-			cd /usr/local/go/src; \
-# set GOROOT_BOOTSTRAP + GOHOST* such that we can build Go successfully
-			export GOROOT_BOOTSTRAP="$(go env GOROOT)" GOHOSTOS="$GOOS" GOHOSTARCH="$GOARCH"; \
-			./make.bash; \
-		); \
-		\
-		apt-mark auto '.*' > /dev/null; \
-		apt-mark manual $savedAptMark > /dev/null; \
-		apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
-		rm -rf /var/lib/apt/lists/*; \
-		\
-# remove a few intermediate / bootstrapping files the official binary release tarballs do not contain
-		rm -rf \
-			/usr/local/go/pkg/*/cmd \
-			/usr/local/go/pkg/bootstrap \
-			/usr/local/go/pkg/obj \
-			/usr/local/go/pkg/tool/*/api \
-			/usr/local/go/pkg/tool/*/go_bootstrap \
-			/usr/local/go/src/cmd/dist/dist \
-			"$GOCACHE" \
-		; \
-	elif [ "$arch" = 'armhf' ]; then \
-		[ -s /usr/local/go/go.env ]; \
-		before="$(go env GOARM)"; [ "$before" != '7' ]; \
-		{ \
-			echo; \
-			echo '# https://github.com/docker-library/golang/issues/494'; \
-			echo 'GOARM=7'; \
-		} >> /usr/local/go/go.env; \
-		after="$(go env GOARM)"; [ "$after" = '7' ]; \
-	fi; \
-	\
 	go version
 
 # don't auto-upgrade the gotoolchain
diff --git a/golang_bullseye/Dockerfile b/golang_bullseye/Dockerfile
index 0b1349c..2b9fe69 100644
--- a/golang_bullseye/Dockerfile
+++ b/golang_bullseye/Dockerfile
@@ -30,9 +30,6 @@ RUN set -eux; \
 			url='https://dl.google.com/go/go1.21.5.linux-amd64.tar.gz'; \
 			sha256='e2bc0b3e4b64111ec117295c088bde5f00eeed1567999ff77bc859d7df70078e'; \
 			;; \
-		'armel') \
-			export GOARCH='arm' GOARM='5' GOOS='linux'; \
-			;; \
 		'armhf') \
 			url='https://dl.google.com/go/go1.21.5.linux-armv6l.tar.gz'; \
 			sha256='837f4bf4e22fcdf920ffeaa4abf3d02d1314e03725431065f4d44c46a01b42fe'; \
@@ -63,16 +60,6 @@ RUN set -eux; \
 			;; \
 		*) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \
 	esac; \
-	build=; \
-	if [ -z "$url" ]; then \
-# https://github.com/golang/go/issues/38536#issuecomment-616897960
-		build=1; \
-		url='https://dl.google.com/go/go1.21.5.src.tar.gz'; \
-		sha256='285cbbdf4b6e6e62ed58f370f3f6d8c30825d6e56c5853c66d3c23bcdb09db19'; \
-		echo >&2; \
-		echo >&2 "warning: current architecture ($arch) does not have a compatible Go binary release; will be building from source"; \
-		echo >&2; \
-	fi; \
 	\
 	wget -O go.tgz.asc "$url.asc"; \
 	wget -O go.tgz "$url" --progress=dot:giga; \
@@ -91,52 +78,6 @@ RUN set -eux; \
 	tar -C /usr/local -xzf go.tgz; \
 	rm go.tgz; \
 	\
-	if [ -n "$build" ]; then \
-		savedAptMark="$(apt-mark showmanual)"; \
-# add backports for newer go version for bootstrap build: https://github.com/golang/go/issues/44505
-		( \
-			. /etc/os-release; \
-			echo "deb https://deb.debian.org/debian $VERSION_CODENAME-backports main" > /etc/apt/sources.list.d/backports.list; \
-			\
-			apt-get update; \
-			apt-get install -y --no-install-recommends -t "$VERSION_CODENAME-backports" golang-go; \
-		); \
-		\
-		export GOCACHE='/tmp/gocache'; \
-		\
-		( \
-			cd /usr/local/go/src; \
-# set GOROOT_BOOTSTRAP + GOHOST* such that we can build Go successfully
-			export GOROOT_BOOTSTRAP="$(go env GOROOT)" GOHOSTOS="$GOOS" GOHOSTARCH="$GOARCH"; \
-			./make.bash; \
-		); \
-		\
-		apt-mark auto '.*' > /dev/null; \
-		apt-mark manual $savedAptMark > /dev/null; \
-		apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
-		rm -rf /var/lib/apt/lists/*; \
-		\
-# remove a few intermediate / bootstrapping files the official binary release tarballs do not contain
-		rm -rf \
-			/usr/local/go/pkg/*/cmd \
-			/usr/local/go/pkg/bootstrap \
-			/usr/local/go/pkg/obj \
-			/usr/local/go/pkg/tool/*/api \
-			/usr/local/go/pkg/tool/*/go_bootstrap \
-			/usr/local/go/src/cmd/dist/dist \
-			"$GOCACHE" \
-		; \
-	elif [ "$arch" = 'armhf' ]; then \
-		[ -s /usr/local/go/go.env ]; \
-		before="$(go env GOARM)"; [ "$before" != '7' ]; \
-		{ \
-			echo; \
-			echo '# https://github.com/docker-library/golang/issues/494'; \
-			echo 'GOARM=7'; \
-		} >> /usr/local/go/go.env; \
-		after="$(go env GOARM)"; [ "$after" = '7' ]; \
-	fi; \
-	\
 	go version
 
 # don't auto-upgrade the gotoolchain

Relevant Maintainers:

@yosifkit yosifkit merged commit c1b64b8 into docker-library:master Dec 20, 2023
23 checks passed
@yosifkit yosifkit deleted the golang branch December 20, 2023 19:47
@samantha-again
Copy link

Thank you for doing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants