diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f75496d..9e33b8bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,7 @@ name: GitHub CI on: pull_request: push: + workflow_dispatch: schedule: - cron: 0 0 * * 0 @@ -10,6 +11,13 @@ defaults: run: shell: 'bash -Eeuo pipefail -x {0}' +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + jobs: generate-jobs: @@ -18,16 +26,17 @@ jobs: outputs: strategy: ${{ steps.generate-jobs.outputs.strategy }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: docker-library/bashbrew@HEAD - id: generate-jobs name: Generate Jobs run: | strategy="$("$BASHBREW_SCRIPTS/github-actions/generate.sh")" - strategy="$(.github/workflows/munge.sh -c <<<"$strategy")" - strategy="$("$BASHBREW_SCRIPTS/github-actions/munge-i386.sh" -c <<<"$strategy")" - echo "strategy=$strategy" >> "$GITHUB_OUTPUT" - jq . <<<"$strategy" # sanity check / debugging aid + + EOF="EOF-$RANDOM-$RANDOM-$RANDOM" + echo "strategy<<$EOF" >> "$GITHUB_OUTPUT" + jq <<<"$strategy" . | tee -a "$GITHUB_OUTPUT" + echo "$EOF" >> "$GITHUB_OUTPUT" test: needs: generate-jobs @@ -35,7 +44,7 @@ jobs: name: ${{ matrix.name }} runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Prepare Environment run: ${{ matrix.runs.prepare }} - name: Pull Dependencies diff --git a/.github/workflows/munge.sh b/.github/workflows/munge.sh deleted file mode 100755 index 34a5a5d5..00000000 --- a/.github/workflows/munge.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -set -Eeuo pipefail - -# we use this to munge "versions.json" to force building on all arches -versionsMunge='.[].arches |= with_entries(if .key != "src" then del(.value.url, .value.sha256) else . end)' -export versionsMunge - -jq ' - .matrix.include += [ - .matrix.include[] - | select(.name | test(" (.+)") | not) # ignore any existing munged builds - | select(.os | startswith("windows-") | not) # ignore Windows (always downloads) - | select(.meta.froms[] | test("^alpine:") | not) # ignore Alpine (already always builds from source) - | select(.meta.froms[] | test("buster") | not) # ignore Debian Buster (not new enough Go, only supports architectures that download) - | .name += " (force build)" - | .runs.build = ([ - "# update versions.json to force us to build Go instead of downloading it", - "jq " + (env.versionsMunge | @sh) + " versions.json | tee versions.munged.json", - "mv versions.munged.json versions.json", - "./apply-templates.sh", - "git diff", - .runs.build - ] | join("\n")) - ] -' "$@" diff --git a/.github/workflows/verify-templating.yml b/.github/workflows/verify-templating.yml index 14497bec..e822ba6b 100644 --- a/.github/workflows/verify-templating.yml +++ b/.github/workflows/verify-templating.yml @@ -3,6 +3,7 @@ name: Verify Templating on: pull_request: push: + workflow_dispatch: defaults: run: @@ -13,10 +14,6 @@ jobs: name: Check For Uncomitted Changes runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Apply Templates - run: ./apply-templates.sh - - name: Check Git Status - run: | - status="$(git status --short)" - [ -z "$status" ] + - uses: actions/checkout@v4 + - run: ./apply-templates.sh + - run: git diff --exit-code diff --git a/1.20/alpine3.17/Dockerfile b/1.20/alpine3.17/Dockerfile deleted file mode 100644 index af510587..00000000 --- a/1.20/alpine3.17/Dockerfile +++ /dev/null @@ -1,114 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM alpine:3.17 - -RUN apk add --no-cache ca-certificates - -ENV PATH /usr/local/go/bin:$PATH - -ENV GOLANG_VERSION 1.20.11 - -RUN set -eux; \ - apk add --no-cache --virtual .fetch-deps gnupg; \ - arch="$(apk --print-arch)"; \ - url=; \ - case "$arch" in \ - 'x86_64') \ - export GOAMD64='v1' GOARCH='amd64' GOOS='linux'; \ - ;; \ - 'armhf') \ - export GOARCH='arm' GOARM='6' GOOS='linux'; \ - ;; \ - 'armv7') \ - export GOARCH='arm' GOARM='7' GOOS='linux'; \ - ;; \ - 'aarch64') \ - export GOARCH='arm64' GOOS='linux'; \ - ;; \ - 'x86') \ - export GO386='softfloat' GOARCH='386' GOOS='linux'; \ - ;; \ - 'ppc64le') \ - export GOARCH='ppc64le' GOOS='linux'; \ - ;; \ - 'riscv64') \ - export GOARCH='riscv64' GOOS='linux'; \ - ;; \ - 's390x') \ - export GOARCH='s390x' GOOS='linux'; \ - ;; \ - *) 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.11.src.tar.gz'; \ - sha256='d355c5ae3a8f7763c9ec9dc25153aae373958cbcb60dd09e91a8b56c7621b2fc'; \ -# 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"; \ - echo "$sha256 *go.tgz" | sha256sum -c -; \ - \ -# https://github.com/golang/go/issues/14739#issuecomment-324767697 - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ -# https://www.google.com/linuxrepositories/ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \ -# let's also fetch the specific subkey of that key explicitly that we expect "go.tgz.asc" to be signed by, just to make sure we definitely have it - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys '2F52 8D36 D67B 69ED F998 D857 78BD 6547 3CB3 BD13'; \ - gpg --batch --verify go.tgz.asc go.tgz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME" go.tgz.asc; \ - \ - 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 - -ENV GOPATH /go -ENV PATH $GOPATH/bin:$PATH -RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH" -WORKDIR $GOPATH diff --git a/1.20/alpine3.18/Dockerfile b/1.20/alpine3.18/Dockerfile deleted file mode 100644 index bad87aed..00000000 --- a/1.20/alpine3.18/Dockerfile +++ /dev/null @@ -1,114 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM alpine:3.18 - -RUN apk add --no-cache ca-certificates - -ENV PATH /usr/local/go/bin:$PATH - -ENV GOLANG_VERSION 1.20.11 - -RUN set -eux; \ - apk add --no-cache --virtual .fetch-deps gnupg; \ - arch="$(apk --print-arch)"; \ - url=; \ - case "$arch" in \ - 'x86_64') \ - export GOAMD64='v1' GOARCH='amd64' GOOS='linux'; \ - ;; \ - 'armhf') \ - export GOARCH='arm' GOARM='6' GOOS='linux'; \ - ;; \ - 'armv7') \ - export GOARCH='arm' GOARM='7' GOOS='linux'; \ - ;; \ - 'aarch64') \ - export GOARCH='arm64' GOOS='linux'; \ - ;; \ - 'x86') \ - export GO386='softfloat' GOARCH='386' GOOS='linux'; \ - ;; \ - 'ppc64le') \ - export GOARCH='ppc64le' GOOS='linux'; \ - ;; \ - 'riscv64') \ - export GOARCH='riscv64' GOOS='linux'; \ - ;; \ - 's390x') \ - export GOARCH='s390x' GOOS='linux'; \ - ;; \ - *) 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.11.src.tar.gz'; \ - sha256='d355c5ae3a8f7763c9ec9dc25153aae373958cbcb60dd09e91a8b56c7621b2fc'; \ -# 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"; \ - echo "$sha256 *go.tgz" | sha256sum -c -; \ - \ -# https://github.com/golang/go/issues/14739#issuecomment-324767697 - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ -# https://www.google.com/linuxrepositories/ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \ -# let's also fetch the specific subkey of that key explicitly that we expect "go.tgz.asc" to be signed by, just to make sure we definitely have it - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys '2F52 8D36 D67B 69ED F998 D857 78BD 6547 3CB3 BD13'; \ - gpg --batch --verify go.tgz.asc go.tgz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME" go.tgz.asc; \ - \ - 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 - -ENV GOPATH /go -ENV PATH $GOPATH/bin:$PATH -RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH" -WORKDIR $GOPATH diff --git a/1.20/bookworm/Dockerfile b/1.20/bookworm/Dockerfile deleted file mode 100644 index 70d8cb4b..00000000 --- a/1.20/bookworm/Dockerfile +++ /dev/null @@ -1,128 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM buildpack-deps:bookworm-scm - -# install cgo-related dependencies -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - g++ \ - gcc \ - libc6-dev \ - make \ - pkg-config \ - ; \ - rm -rf /var/lib/apt/lists/* - -ENV PATH /usr/local/go/bin:$PATH - -ENV GOLANG_VERSION 1.20.11 - -RUN set -eux; \ - arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ - url=; \ - case "$arch" in \ - 'amd64') \ - url='https://dl.google.com/go/go1.20.11.linux-amd64.tar.gz'; \ - sha256='ef79a11aa095a08772d2a69e4f152f897c4e96ee297b0dc20264b7dec2961abe'; \ - ;; \ - 'armel') \ - export GOARCH='arm' GOARM='5' GOOS='linux'; \ - ;; \ - 'armhf') \ - url='https://dl.google.com/go/go1.20.11.linux-armv6l.tar.gz'; \ - sha256='636a1b4d75c739f4d6373b36d7d278e25523141d4d69eb1bde5526ed56a49635'; \ - ;; \ - 'arm64') \ - url='https://dl.google.com/go/go1.20.11.linux-arm64.tar.gz'; \ - sha256='7908a49c6ce9d48af9b5ba76ccaa0769da45d8b635259a01065b3739acef4ada'; \ - ;; \ - 'i386') \ - url='https://dl.google.com/go/go1.20.11.linux-386.tar.gz'; \ - sha256='168b11bbc30f5a18671412fb9535ede76b3d98389be01ba37319635eea76de24'; \ - ;; \ - 'mips64el') \ - export GOARCH='mips64le' GOOS='linux'; \ - ;; \ - 'ppc64el') \ - url='https://dl.google.com/go/go1.20.11.linux-ppc64le.tar.gz'; \ - sha256='e04676e1aeafe7c415176f330322d43a4be5ea6deb14aca49905bd1449dc7072'; \ - ;; \ - 'riscv64') \ - export GOARCH='riscv64' GOOS='linux'; \ - ;; \ - 's390x') \ - url='https://dl.google.com/go/go1.20.11.linux-s390x.tar.gz'; \ - sha256='6112113758b7994249db5d33c34723cd2b2f96d0d80ece07c0e59a91e45912db'; \ - ;; \ - *) 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.11.src.tar.gz'; \ - sha256='d355c5ae3a8f7763c9ec9dc25153aae373958cbcb60dd09e91a8b56c7621b2fc'; \ - 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; \ - echo "$sha256 *go.tgz" | sha256sum -c -; \ - \ -# https://github.com/golang/go/issues/14739#issuecomment-324767697 - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ -# https://www.google.com/linuxrepositories/ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \ -# let's also fetch the specific subkey of that key explicitly that we expect "go.tgz.asc" to be signed by, just to make sure we definitely have it - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys '2F52 8D36 D67B 69ED F998 D857 78BD 6547 3CB3 BD13'; \ - gpg --batch --verify go.tgz.asc go.tgz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME" go.tgz.asc; \ - \ - 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 - -ENV GOPATH /go -ENV PATH $GOPATH/bin:$PATH -RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH" -WORKDIR $GOPATH diff --git a/1.20/bullseye/Dockerfile b/1.20/bullseye/Dockerfile deleted file mode 100644 index ccde69b7..00000000 --- a/1.20/bullseye/Dockerfile +++ /dev/null @@ -1,134 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM buildpack-deps:bullseye-scm - -# install cgo-related dependencies -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - g++ \ - gcc \ - libc6-dev \ - make \ - pkg-config \ - ; \ - rm -rf /var/lib/apt/lists/* - -ENV PATH /usr/local/go/bin:$PATH - -ENV GOLANG_VERSION 1.20.11 - -RUN set -eux; \ - arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ - url=; \ - case "$arch" in \ - 'amd64') \ - url='https://dl.google.com/go/go1.20.11.linux-amd64.tar.gz'; \ - sha256='ef79a11aa095a08772d2a69e4f152f897c4e96ee297b0dc20264b7dec2961abe'; \ - ;; \ - 'armel') \ - export GOARCH='arm' GOARM='5' GOOS='linux'; \ - ;; \ - 'armhf') \ - url='https://dl.google.com/go/go1.20.11.linux-armv6l.tar.gz'; \ - sha256='636a1b4d75c739f4d6373b36d7d278e25523141d4d69eb1bde5526ed56a49635'; \ - ;; \ - 'arm64') \ - url='https://dl.google.com/go/go1.20.11.linux-arm64.tar.gz'; \ - sha256='7908a49c6ce9d48af9b5ba76ccaa0769da45d8b635259a01065b3739acef4ada'; \ - ;; \ - 'i386') \ - url='https://dl.google.com/go/go1.20.11.linux-386.tar.gz'; \ - sha256='168b11bbc30f5a18671412fb9535ede76b3d98389be01ba37319635eea76de24'; \ - ;; \ - 'mips64el') \ - export GOARCH='mips64le' GOOS='linux'; \ - ;; \ - 'ppc64el') \ - url='https://dl.google.com/go/go1.20.11.linux-ppc64le.tar.gz'; \ - sha256='e04676e1aeafe7c415176f330322d43a4be5ea6deb14aca49905bd1449dc7072'; \ - ;; \ - 'riscv64') \ - export GOARCH='riscv64' GOOS='linux'; \ - ;; \ - 's390x') \ - url='https://dl.google.com/go/go1.20.11.linux-s390x.tar.gz'; \ - sha256='6112113758b7994249db5d33c34723cd2b2f96d0d80ece07c0e59a91e45912db'; \ - ;; \ - *) 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.11.src.tar.gz'; \ - sha256='d355c5ae3a8f7763c9ec9dc25153aae373958cbcb60dd09e91a8b56c7621b2fc'; \ - 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; \ - echo "$sha256 *go.tgz" | sha256sum -c -; \ - \ -# https://github.com/golang/go/issues/14739#issuecomment-324767697 - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ -# https://www.google.com/linuxrepositories/ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \ -# let's also fetch the specific subkey of that key explicitly that we expect "go.tgz.asc" to be signed by, just to make sure we definitely have it - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys '2F52 8D36 D67B 69ED F998 D857 78BD 6547 3CB3 BD13'; \ - gpg --batch --verify go.tgz.asc go.tgz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME" go.tgz.asc; \ - \ - 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" \ - ; \ - fi; \ - \ - go version - -ENV GOPATH /go -ENV PATH $GOPATH/bin:$PATH -RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH" -WORKDIR $GOPATH diff --git a/1.21/alpine3.17/Dockerfile b/1.21/alpine3.17/Dockerfile deleted file mode 100644 index ee776668..00000000 --- a/1.21/alpine3.17/Dockerfile +++ /dev/null @@ -1,128 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM alpine:3.17 - -RUN apk add --no-cache ca-certificates - -ENV PATH /usr/local/go/bin:$PATH - -ENV GOLANG_VERSION 1.21.4 - -RUN set -eux; \ - apk add --no-cache --virtual .fetch-deps gnupg; \ - arch="$(apk --print-arch)"; \ - url=; \ - case "$arch" in \ - 'x86_64') \ - url='https://dl.google.com/go/go1.21.4.linux-amd64.tar.gz'; \ - sha256='73cac0215254d0c7d1241fa40837851f3b9a8a742d0b54714cbdfb3feaf8f0af'; \ - ;; \ - 'armhf') \ - url='https://dl.google.com/go/go1.21.4.linux-armv6l.tar.gz'; \ - sha256='6c62e89113750cc77c498194d13a03fadfda22bd2c7d44e8a826fd354db60252'; \ - ;; \ - 'armv7') \ - url='https://dl.google.com/go/go1.21.4.linux-armv6l.tar.gz'; \ - sha256='6c62e89113750cc77c498194d13a03fadfda22bd2c7d44e8a826fd354db60252'; \ - ;; \ - 'aarch64') \ - url='https://dl.google.com/go/go1.21.4.linux-arm64.tar.gz'; \ - sha256='ce1983a7289856c3a918e1fd26d41e072cc39f928adfb11ba1896440849b95da'; \ - ;; \ - 'x86') \ - url='https://dl.google.com/go/go1.21.4.linux-386.tar.gz'; \ - sha256='64d3e5d295806e137c9e39d1e1f10b00a30fcd5c2f230d72b3298f579bb3c89a'; \ - ;; \ - 'ppc64le') \ - url='https://dl.google.com/go/go1.21.4.linux-ppc64le.tar.gz'; \ - sha256='2c63b36d2adcfb22013102a2ee730f058ec2f93b9f27479793c80b2e3641783f'; \ - ;; \ - 'riscv64') \ - url='https://dl.google.com/go/go1.21.4.linux-riscv64.tar.gz'; \ - sha256='9695edd2109544b364daddb32816f5c7980f1f48b8490c51fa2c167f5b2eca48'; \ - ;; \ - 's390x') \ - url='https://dl.google.com/go/go1.21.4.linux-s390x.tar.gz'; \ - sha256='7a75ba4afc7a96058ca65903d994cd862381825d7dca12b2183f087c757c26c0'; \ - ;; \ - *) 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.4.src.tar.gz'; \ - sha256='47b26a83d2b65a3c1c1bcace273b69bee49a7a7b5168a7604ded3d26a37bd787'; \ - 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"; \ - echo "$sha256 *go.tgz" | sha256sum -c -; \ - \ -# https://github.com/golang/go/issues/14739#issuecomment-324767697 - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ -# https://www.google.com/linuxrepositories/ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \ -# let's also fetch the specific subkey of that key explicitly that we expect "go.tgz.asc" to be signed by, just to make sure we definitely have it - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys '2F52 8D36 D67B 69ED F998 D857 78BD 6547 3CB3 BD13'; \ - gpg --batch --verify go.tgz.asc go.tgz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME" go.tgz.asc; \ - \ - 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" -WORKDIR $GOPATH diff --git a/1.21/alpine3.18/Dockerfile b/1.21/alpine3.18/Dockerfile deleted file mode 100644 index bdad98b1..00000000 --- a/1.21/alpine3.18/Dockerfile +++ /dev/null @@ -1,128 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM alpine:3.18 - -RUN apk add --no-cache ca-certificates - -ENV PATH /usr/local/go/bin:$PATH - -ENV GOLANG_VERSION 1.21.4 - -RUN set -eux; \ - apk add --no-cache --virtual .fetch-deps gnupg; \ - arch="$(apk --print-arch)"; \ - url=; \ - case "$arch" in \ - 'x86_64') \ - url='https://dl.google.com/go/go1.21.4.linux-amd64.tar.gz'; \ - sha256='73cac0215254d0c7d1241fa40837851f3b9a8a742d0b54714cbdfb3feaf8f0af'; \ - ;; \ - 'armhf') \ - url='https://dl.google.com/go/go1.21.4.linux-armv6l.tar.gz'; \ - sha256='6c62e89113750cc77c498194d13a03fadfda22bd2c7d44e8a826fd354db60252'; \ - ;; \ - 'armv7') \ - url='https://dl.google.com/go/go1.21.4.linux-armv6l.tar.gz'; \ - sha256='6c62e89113750cc77c498194d13a03fadfda22bd2c7d44e8a826fd354db60252'; \ - ;; \ - 'aarch64') \ - url='https://dl.google.com/go/go1.21.4.linux-arm64.tar.gz'; \ - sha256='ce1983a7289856c3a918e1fd26d41e072cc39f928adfb11ba1896440849b95da'; \ - ;; \ - 'x86') \ - url='https://dl.google.com/go/go1.21.4.linux-386.tar.gz'; \ - sha256='64d3e5d295806e137c9e39d1e1f10b00a30fcd5c2f230d72b3298f579bb3c89a'; \ - ;; \ - 'ppc64le') \ - url='https://dl.google.com/go/go1.21.4.linux-ppc64le.tar.gz'; \ - sha256='2c63b36d2adcfb22013102a2ee730f058ec2f93b9f27479793c80b2e3641783f'; \ - ;; \ - 'riscv64') \ - url='https://dl.google.com/go/go1.21.4.linux-riscv64.tar.gz'; \ - sha256='9695edd2109544b364daddb32816f5c7980f1f48b8490c51fa2c167f5b2eca48'; \ - ;; \ - 's390x') \ - url='https://dl.google.com/go/go1.21.4.linux-s390x.tar.gz'; \ - sha256='7a75ba4afc7a96058ca65903d994cd862381825d7dca12b2183f087c757c26c0'; \ - ;; \ - *) 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.4.src.tar.gz'; \ - sha256='47b26a83d2b65a3c1c1bcace273b69bee49a7a7b5168a7604ded3d26a37bd787'; \ - 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"; \ - echo "$sha256 *go.tgz" | sha256sum -c -; \ - \ -# https://github.com/golang/go/issues/14739#issuecomment-324767697 - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ -# https://www.google.com/linuxrepositories/ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \ -# let's also fetch the specific subkey of that key explicitly that we expect "go.tgz.asc" to be signed by, just to make sure we definitely have it - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys '2F52 8D36 D67B 69ED F998 D857 78BD 6547 3CB3 BD13'; \ - gpg --batch --verify go.tgz.asc go.tgz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME" go.tgz.asc; \ - \ - 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" -WORKDIR $GOPATH diff --git a/1.21/bookworm/Dockerfile b/1.21/bookworm/Dockerfile deleted file mode 100644 index d89a3c93..00000000 --- a/1.21/bookworm/Dockerfile +++ /dev/null @@ -1,134 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM buildpack-deps:bookworm-scm - -# install cgo-related dependencies -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - g++ \ - gcc \ - libc6-dev \ - make \ - pkg-config \ - ; \ - rm -rf /var/lib/apt/lists/* - -ENV PATH /usr/local/go/bin:$PATH - -ENV GOLANG_VERSION 1.21.4 - -RUN set -eux; \ - arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ - url=; \ - case "$arch" in \ - 'amd64') \ - url='https://dl.google.com/go/go1.21.4.linux-amd64.tar.gz'; \ - sha256='73cac0215254d0c7d1241fa40837851f3b9a8a742d0b54714cbdfb3feaf8f0af'; \ - ;; \ - 'armel') \ - export GOARCH='arm' GOARM='5' GOOS='linux'; \ - ;; \ - 'armhf') \ - url='https://dl.google.com/go/go1.21.4.linux-armv6l.tar.gz'; \ - sha256='6c62e89113750cc77c498194d13a03fadfda22bd2c7d44e8a826fd354db60252'; \ - ;; \ - 'arm64') \ - url='https://dl.google.com/go/go1.21.4.linux-arm64.tar.gz'; \ - sha256='ce1983a7289856c3a918e1fd26d41e072cc39f928adfb11ba1896440849b95da'; \ - ;; \ - 'i386') \ - url='https://dl.google.com/go/go1.21.4.linux-386.tar.gz'; \ - sha256='64d3e5d295806e137c9e39d1e1f10b00a30fcd5c2f230d72b3298f579bb3c89a'; \ - ;; \ - 'mips64el') \ - url='https://dl.google.com/go/go1.21.4.linux-mips64le.tar.gz'; \ - sha256='c7ce3a9dcf03322b79beda474c4a0154393d9029b48f7c2e260fb3365c8a6ad3'; \ - ;; \ - 'ppc64el') \ - url='https://dl.google.com/go/go1.21.4.linux-ppc64le.tar.gz'; \ - sha256='2c63b36d2adcfb22013102a2ee730f058ec2f93b9f27479793c80b2e3641783f'; \ - ;; \ - 'riscv64') \ - url='https://dl.google.com/go/go1.21.4.linux-riscv64.tar.gz'; \ - sha256='9695edd2109544b364daddb32816f5c7980f1f48b8490c51fa2c167f5b2eca48'; \ - ;; \ - 's390x') \ - url='https://dl.google.com/go/go1.21.4.linux-s390x.tar.gz'; \ - sha256='7a75ba4afc7a96058ca65903d994cd862381825d7dca12b2183f087c757c26c0'; \ - ;; \ - *) 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.4.src.tar.gz'; \ - sha256='47b26a83d2b65a3c1c1bcace273b69bee49a7a7b5168a7604ded3d26a37bd787'; \ - 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; \ - echo "$sha256 *go.tgz" | sha256sum -c -; \ - \ -# https://github.com/golang/go/issues/14739#issuecomment-324767697 - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ -# https://www.google.com/linuxrepositories/ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \ -# let's also fetch the specific subkey of that key explicitly that we expect "go.tgz.asc" to be signed by, just to make sure we definitely have it - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys '2F52 8D36 D67B 69ED F998 D857 78BD 6547 3CB3 BD13'; \ - gpg --batch --verify go.tgz.asc go.tgz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME" go.tgz.asc; \ - \ - 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" -WORKDIR $GOPATH diff --git a/1.21/bullseye/Dockerfile b/1.21/bullseye/Dockerfile deleted file mode 100644 index dadd5649..00000000 --- a/1.21/bullseye/Dockerfile +++ /dev/null @@ -1,140 +0,0 @@ -# -# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" -# -# PLEASE DO NOT EDIT IT DIRECTLY. -# - -FROM buildpack-deps:bullseye-scm - -# install cgo-related dependencies -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - g++ \ - gcc \ - libc6-dev \ - make \ - pkg-config \ - ; \ - rm -rf /var/lib/apt/lists/* - -ENV PATH /usr/local/go/bin:$PATH - -ENV GOLANG_VERSION 1.21.4 - -RUN set -eux; \ - arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ - url=; \ - case "$arch" in \ - 'amd64') \ - url='https://dl.google.com/go/go1.21.4.linux-amd64.tar.gz'; \ - sha256='73cac0215254d0c7d1241fa40837851f3b9a8a742d0b54714cbdfb3feaf8f0af'; \ - ;; \ - 'armel') \ - export GOARCH='arm' GOARM='5' GOOS='linux'; \ - ;; \ - 'armhf') \ - url='https://dl.google.com/go/go1.21.4.linux-armv6l.tar.gz'; \ - sha256='6c62e89113750cc77c498194d13a03fadfda22bd2c7d44e8a826fd354db60252'; \ - ;; \ - 'arm64') \ - url='https://dl.google.com/go/go1.21.4.linux-arm64.tar.gz'; \ - sha256='ce1983a7289856c3a918e1fd26d41e072cc39f928adfb11ba1896440849b95da'; \ - ;; \ - 'i386') \ - url='https://dl.google.com/go/go1.21.4.linux-386.tar.gz'; \ - sha256='64d3e5d295806e137c9e39d1e1f10b00a30fcd5c2f230d72b3298f579bb3c89a'; \ - ;; \ - 'mips64el') \ - url='https://dl.google.com/go/go1.21.4.linux-mips64le.tar.gz'; \ - sha256='c7ce3a9dcf03322b79beda474c4a0154393d9029b48f7c2e260fb3365c8a6ad3'; \ - ;; \ - 'ppc64el') \ - url='https://dl.google.com/go/go1.21.4.linux-ppc64le.tar.gz'; \ - sha256='2c63b36d2adcfb22013102a2ee730f058ec2f93b9f27479793c80b2e3641783f'; \ - ;; \ - 'riscv64') \ - url='https://dl.google.com/go/go1.21.4.linux-riscv64.tar.gz'; \ - sha256='9695edd2109544b364daddb32816f5c7980f1f48b8490c51fa2c167f5b2eca48'; \ - ;; \ - 's390x') \ - url='https://dl.google.com/go/go1.21.4.linux-s390x.tar.gz'; \ - sha256='7a75ba4afc7a96058ca65903d994cd862381825d7dca12b2183f087c757c26c0'; \ - ;; \ - *) 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.4.src.tar.gz'; \ - sha256='47b26a83d2b65a3c1c1bcace273b69bee49a7a7b5168a7604ded3d26a37bd787'; \ - 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; \ - echo "$sha256 *go.tgz" | sha256sum -c -; \ - \ -# https://github.com/golang/go/issues/14739#issuecomment-324767697 - GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ -# https://www.google.com/linuxrepositories/ - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \ -# let's also fetch the specific subkey of that key explicitly that we expect "go.tgz.asc" to be signed by, just to make sure we definitely have it - gpg --batch --keyserver keyserver.ubuntu.com --recv-keys '2F52 8D36 D67B 69ED F998 D857 78BD 6547 3CB3 BD13'; \ - gpg --batch --verify go.tgz.asc go.tgz; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME" go.tgz.asc; \ - \ - 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" \ - ; \ - 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" -WORKDIR $GOPATH diff --git a/1.23/alpine3.21/Dockerfile b/1.23/alpine3.21/Dockerfile new file mode 100644 index 00000000..429b9647 --- /dev/null +++ b/1.23/alpine3.21/Dockerfile @@ -0,0 +1,128 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.21 AS build + +ENV PATH /usr/local/go/bin:$PATH + +ENV GOLANG_VERSION 1.23.10 + +RUN set -eux; \ + now="$(date '+%s')"; \ + apk add --no-cache --virtual .fetch-deps \ + ca-certificates \ + gnupg \ +# busybox's "tar" doesn't handle directory mtime correctly, so our SOURCE_DATE_EPOCH lookup doesn't work (the mtime of "/usr/local/go" always ends up being the extraction timestamp) + tar \ + ; \ + arch="$(apk --print-arch)"; \ + url=; \ + case "$arch" in \ + 'x86_64') \ + url='https://dl.google.com/go/go1.23.10.linux-amd64.tar.gz'; \ + sha256='535f9f81802499f2a7dbfa70abb8fda3793725fcc29460f719815f6e10b5fd60'; \ + ;; \ + 'armhf') \ + url='https://dl.google.com/go/go1.23.10.linux-armv6l.tar.gz'; \ + sha256='b6e00c9a72406d394b9f167e74670e28b72ed559cca8115b21be1cb9d5316cb4'; \ + ;; \ + 'armv7') \ + url='https://dl.google.com/go/go1.23.10.linux-armv6l.tar.gz'; \ + sha256='b6e00c9a72406d394b9f167e74670e28b72ed559cca8115b21be1cb9d5316cb4'; \ + ;; \ + 'aarch64') \ + url='https://dl.google.com/go/go1.23.10.linux-arm64.tar.gz'; \ + sha256='bfb1f1df7173f44648ee070a39ab0481068632f595305a699d89cd56a33b8081'; \ + ;; \ + 'x86') \ + url='https://dl.google.com/go/go1.23.10.linux-386.tar.gz'; \ + sha256='ded3c0a8d6d2a0ea5e7599c49678efa05cda139d31baaaf7d8d536a9e4cc19b2'; \ + ;; \ + 'ppc64le') \ + url='https://dl.google.com/go/go1.23.10.linux-ppc64le.tar.gz'; \ + sha256='8fb94455cfa5e9a5e8af2bfbc7323a6fed2dabaffda1a69dae5dd41b669bbb57'; \ + ;; \ + 'riscv64') \ + url='https://dl.google.com/go/go1.23.10.linux-riscv64.tar.gz'; \ + sha256='ed68dbd165b2d2bf3725239a5bad852493b0de8ea45fa7a585159a63e0e1194a'; \ + ;; \ + 's390x') \ + url='https://dl.google.com/go/go1.23.10.linux-s390x.tar.gz'; \ + sha256='7d0e8651eb54fce5cfe2d4b412ddfa50144ce21907f72192a6549ffe03db4e1f'; \ + ;; \ + *) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \ + esac; \ + \ + wget -O go.tgz.asc "$url.asc"; \ + wget -O go.tgz "$url"; \ + echo "$sha256 *go.tgz" | sha256sum -c -; \ + \ +# https://github.com/golang/go/issues/14739#issuecomment-324767697 + GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ +# https://www.google.com/linuxrepositories/ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \ +# let's also fetch the specific subkey of that key explicitly that we expect "go.tgz.asc" to be signed by, just to make sure we definitely have it + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys '2F52 8D36 D67B 69ED F998 D857 78BD 6547 3CB3 BD13'; \ + gpg --batch --verify go.tgz.asc go.tgz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME" go.tgz.asc; \ + \ + tar -C /usr/local -xzf go.tgz; \ + rm go.tgz; \ + \ +# save the timestamp from the tarball so we can restore it for reproducibility, if necessary (see below) + SOURCE_DATE_EPOCH="$(stat -c '%Y' /usr/local/go)"; \ + export SOURCE_DATE_EPOCH; \ + touchy="$(date -d "@$SOURCE_DATE_EPOCH" '+%Y%m%d%H%M.%S')"; \ +# for logging validation/edification + date --date "@$SOURCE_DATE_EPOCH" --rfc-2822; \ +# sanity check (detected value should be older than our wall clock) + [ "$SOURCE_DATE_EPOCH" -lt "$now" ]; \ + \ + if [ "$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' ]; \ +# (re-)clamp timestamp for reproducibility (allows "COPY --link" to be more clever/useful) + touch -t "$touchy" /usr/local/go/go.env /usr/local/go; \ + fi; \ + \ +# ideally at this point, we would just "COPY --link ... /usr/local/go/ /usr/local/go/" but BuildKit insists on creating the parent directories (perhaps related to https://github.com/opencontainers/image-spec/pull/970), and does so with unreproducible timestamps, so we instead create a whole new "directory tree" that we can "COPY --link" to accomplish what we want + mkdir /target /target/usr /target/usr/local; \ + mv -vT /usr/local/go /target/usr/local/go; \ + ln -svfT /target/usr/local/go /usr/local/go; \ + touch -t "$touchy" /target/usr/local /target/usr /target; \ + \ + apk del --no-network .fetch-deps; \ + \ +# smoke test + go version; \ +# make sure our reproducibile timestamp is probably still correct (best-effort inline reproducibility test) + epoch="$(stat -c '%Y' /target/usr/local/go)"; \ + [ "$SOURCE_DATE_EPOCH" = "$epoch" ]; \ + find /target -newer /target/usr/local/go -exec sh -c 'ls -ld "$@" && exit "$#"' -- '{}' + + +FROM alpine:3.21 + +RUN apk add --no-cache ca-certificates + +ENV GOLANG_VERSION 1.23.10 + +# don't auto-upgrade the gotoolchain +# https://github.com/docker-library/golang/issues/472 +ENV GOTOOLCHAIN=local + +ENV GOPATH /go +ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH +# (see notes above about "COPY --link") +COPY --from=build --link /target/ / +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH" +WORKDIR $GOPATH diff --git a/1.23/alpine3.22/Dockerfile b/1.23/alpine3.22/Dockerfile new file mode 100644 index 00000000..d86cbf13 --- /dev/null +++ b/1.23/alpine3.22/Dockerfile @@ -0,0 +1,128 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.22 AS build + +ENV PATH /usr/local/go/bin:$PATH + +ENV GOLANG_VERSION 1.23.10 + +RUN set -eux; \ + now="$(date '+%s')"; \ + apk add --no-cache --virtual .fetch-deps \ + ca-certificates \ + gnupg \ +# busybox's "tar" doesn't handle directory mtime correctly, so our SOURCE_DATE_EPOCH lookup doesn't work (the mtime of "/usr/local/go" always ends up being the extraction timestamp) + tar \ + ; \ + arch="$(apk --print-arch)"; \ + url=; \ + case "$arch" in \ + 'x86_64') \ + url='https://dl.google.com/go/go1.23.10.linux-amd64.tar.gz'; \ + sha256='535f9f81802499f2a7dbfa70abb8fda3793725fcc29460f719815f6e10b5fd60'; \ + ;; \ + 'armhf') \ + url='https://dl.google.com/go/go1.23.10.linux-armv6l.tar.gz'; \ + sha256='b6e00c9a72406d394b9f167e74670e28b72ed559cca8115b21be1cb9d5316cb4'; \ + ;; \ + 'armv7') \ + url='https://dl.google.com/go/go1.23.10.linux-armv6l.tar.gz'; \ + sha256='b6e00c9a72406d394b9f167e74670e28b72ed559cca8115b21be1cb9d5316cb4'; \ + ;; \ + 'aarch64') \ + url='https://dl.google.com/go/go1.23.10.linux-arm64.tar.gz'; \ + sha256='bfb1f1df7173f44648ee070a39ab0481068632f595305a699d89cd56a33b8081'; \ + ;; \ + 'x86') \ + url='https://dl.google.com/go/go1.23.10.linux-386.tar.gz'; \ + sha256='ded3c0a8d6d2a0ea5e7599c49678efa05cda139d31baaaf7d8d536a9e4cc19b2'; \ + ;; \ + 'ppc64le') \ + url='https://dl.google.com/go/go1.23.10.linux-ppc64le.tar.gz'; \ + sha256='8fb94455cfa5e9a5e8af2bfbc7323a6fed2dabaffda1a69dae5dd41b669bbb57'; \ + ;; \ + 'riscv64') \ + url='https://dl.google.com/go/go1.23.10.linux-riscv64.tar.gz'; \ + sha256='ed68dbd165b2d2bf3725239a5bad852493b0de8ea45fa7a585159a63e0e1194a'; \ + ;; \ + 's390x') \ + url='https://dl.google.com/go/go1.23.10.linux-s390x.tar.gz'; \ + sha256='7d0e8651eb54fce5cfe2d4b412ddfa50144ce21907f72192a6549ffe03db4e1f'; \ + ;; \ + *) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \ + esac; \ + \ + wget -O go.tgz.asc "$url.asc"; \ + wget -O go.tgz "$url"; \ + echo "$sha256 *go.tgz" | sha256sum -c -; \ + \ +# https://github.com/golang/go/issues/14739#issuecomment-324767697 + GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ +# https://www.google.com/linuxrepositories/ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \ +# let's also fetch the specific subkey of that key explicitly that we expect "go.tgz.asc" to be signed by, just to make sure we definitely have it + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys '2F52 8D36 D67B 69ED F998 D857 78BD 6547 3CB3 BD13'; \ + gpg --batch --verify go.tgz.asc go.tgz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME" go.tgz.asc; \ + \ + tar -C /usr/local -xzf go.tgz; \ + rm go.tgz; \ + \ +# save the timestamp from the tarball so we can restore it for reproducibility, if necessary (see below) + SOURCE_DATE_EPOCH="$(stat -c '%Y' /usr/local/go)"; \ + export SOURCE_DATE_EPOCH; \ + touchy="$(date -d "@$SOURCE_DATE_EPOCH" '+%Y%m%d%H%M.%S')"; \ +# for logging validation/edification + date --date "@$SOURCE_DATE_EPOCH" --rfc-2822; \ +# sanity check (detected value should be older than our wall clock) + [ "$SOURCE_DATE_EPOCH" -lt "$now" ]; \ + \ + if [ "$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' ]; \ +# (re-)clamp timestamp for reproducibility (allows "COPY --link" to be more clever/useful) + touch -t "$touchy" /usr/local/go/go.env /usr/local/go; \ + fi; \ + \ +# ideally at this point, we would just "COPY --link ... /usr/local/go/ /usr/local/go/" but BuildKit insists on creating the parent directories (perhaps related to https://github.com/opencontainers/image-spec/pull/970), and does so with unreproducible timestamps, so we instead create a whole new "directory tree" that we can "COPY --link" to accomplish what we want + mkdir /target /target/usr /target/usr/local; \ + mv -vT /usr/local/go /target/usr/local/go; \ + ln -svfT /target/usr/local/go /usr/local/go; \ + touch -t "$touchy" /target/usr/local /target/usr /target; \ + \ + apk del --no-network .fetch-deps; \ + \ +# smoke test + go version; \ +# make sure our reproducibile timestamp is probably still correct (best-effort inline reproducibility test) + epoch="$(stat -c '%Y' /target/usr/local/go)"; \ + [ "$SOURCE_DATE_EPOCH" = "$epoch" ]; \ + find /target -newer /target/usr/local/go -exec sh -c 'ls -ld "$@" && exit "$#"' -- '{}' + + +FROM alpine:3.22 + +RUN apk add --no-cache ca-certificates + +ENV GOLANG_VERSION 1.23.10 + +# don't auto-upgrade the gotoolchain +# https://github.com/docker-library/golang/issues/472 +ENV GOTOOLCHAIN=local + +ENV GOPATH /go +ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH +# (see notes above about "COPY --link") +COPY --from=build --link /target/ / +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH" +WORKDIR $GOPATH diff --git a/1.23/bookworm/Dockerfile b/1.23/bookworm/Dockerfile new file mode 100644 index 00000000..1648a383 --- /dev/null +++ b/1.23/bookworm/Dockerfile @@ -0,0 +1,130 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM buildpack-deps:bookworm-scm AS build + +ENV PATH /usr/local/go/bin:$PATH + +ENV GOLANG_VERSION 1.23.10 + +RUN set -eux; \ + now="$(date '+%s')"; \ + arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ + url=; \ + case "$arch" in \ + 'amd64') \ + url='https://dl.google.com/go/go1.23.10.linux-amd64.tar.gz'; \ + sha256='535f9f81802499f2a7dbfa70abb8fda3793725fcc29460f719815f6e10b5fd60'; \ + ;; \ + 'armhf') \ + url='https://dl.google.com/go/go1.23.10.linux-armv6l.tar.gz'; \ + sha256='b6e00c9a72406d394b9f167e74670e28b72ed559cca8115b21be1cb9d5316cb4'; \ + ;; \ + 'arm64') \ + url='https://dl.google.com/go/go1.23.10.linux-arm64.tar.gz'; \ + sha256='bfb1f1df7173f44648ee070a39ab0481068632f595305a699d89cd56a33b8081'; \ + ;; \ + 'i386') \ + url='https://dl.google.com/go/go1.23.10.linux-386.tar.gz'; \ + sha256='ded3c0a8d6d2a0ea5e7599c49678efa05cda139d31baaaf7d8d536a9e4cc19b2'; \ + ;; \ + 'mips64el') \ + url='https://dl.google.com/go/go1.23.10.linux-mips64le.tar.gz'; \ + sha256='3d9a542d761877bcf46ad7ae900460a6d3d50f4a3691a40c8535128addf45a11'; \ + ;; \ + 'ppc64el') \ + url='https://dl.google.com/go/go1.23.10.linux-ppc64le.tar.gz'; \ + sha256='8fb94455cfa5e9a5e8af2bfbc7323a6fed2dabaffda1a69dae5dd41b669bbb57'; \ + ;; \ + 'riscv64') \ + url='https://dl.google.com/go/go1.23.10.linux-riscv64.tar.gz'; \ + sha256='ed68dbd165b2d2bf3725239a5bad852493b0de8ea45fa7a585159a63e0e1194a'; \ + ;; \ + 's390x') \ + url='https://dl.google.com/go/go1.23.10.linux-s390x.tar.gz'; \ + sha256='7d0e8651eb54fce5cfe2d4b412ddfa50144ce21907f72192a6549ffe03db4e1f'; \ + ;; \ + *) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \ + esac; \ + \ + wget -O go.tgz.asc "$url.asc"; \ + wget -O go.tgz "$url" --progress=dot:giga; \ + echo "$sha256 *go.tgz" | sha256sum -c -; \ + \ +# https://github.com/golang/go/issues/14739#issuecomment-324767697 + GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ +# https://www.google.com/linuxrepositories/ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \ +# let's also fetch the specific subkey of that key explicitly that we expect "go.tgz.asc" to be signed by, just to make sure we definitely have it + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys '2F52 8D36 D67B 69ED F998 D857 78BD 6547 3CB3 BD13'; \ + gpg --batch --verify go.tgz.asc go.tgz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME" go.tgz.asc; \ + \ + tar -C /usr/local -xzf go.tgz; \ + rm go.tgz; \ + \ +# save the timestamp from the tarball so we can restore it for reproducibility, if necessary (see below) + SOURCE_DATE_EPOCH="$(stat -c '%Y' /usr/local/go)"; \ + export SOURCE_DATE_EPOCH; \ + touchy="$(date -d "@$SOURCE_DATE_EPOCH" '+%Y%m%d%H%M.%S')"; \ +# for logging validation/edification + date --date "@$SOURCE_DATE_EPOCH" --rfc-2822; \ +# sanity check (detected value should be older than our wall clock) + [ "$SOURCE_DATE_EPOCH" -lt "$now" ]; \ + \ + if [ "$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' ]; \ +# (re-)clamp timestamp for reproducibility (allows "COPY --link" to be more clever/useful) + touch -t "$touchy" /usr/local/go/go.env /usr/local/go; \ + fi; \ + \ +# ideally at this point, we would just "COPY --link ... /usr/local/go/ /usr/local/go/" but BuildKit insists on creating the parent directories (perhaps related to https://github.com/opencontainers/image-spec/pull/970), and does so with unreproducible timestamps, so we instead create a whole new "directory tree" that we can "COPY --link" to accomplish what we want + mkdir /target /target/usr /target/usr/local; \ + mv -vT /usr/local/go /target/usr/local/go; \ + ln -svfT /target/usr/local/go /usr/local/go; \ + touch -t "$touchy" /target/usr/local /target/usr /target; \ + \ +# smoke test + go version; \ +# make sure our reproducibile timestamp is probably still correct (best-effort inline reproducibility test) + epoch="$(stat -c '%Y' /target/usr/local/go)"; \ + [ "$SOURCE_DATE_EPOCH" = "$epoch" ]; \ + find /target -newer /target/usr/local/go -exec sh -c 'ls -ld "$@" && exit "$#"' -- '{}' + + +FROM buildpack-deps:bookworm-scm + +# install cgo-related dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + g++ \ + gcc \ + libc6-dev \ + make \ + pkg-config \ + ; \ + rm -rf /var/lib/apt/lists/* + +ENV GOLANG_VERSION 1.23.10 + +# don't auto-upgrade the gotoolchain +# https://github.com/docker-library/golang/issues/472 +ENV GOTOOLCHAIN=local + +ENV GOPATH /go +ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH +# (see notes above about "COPY --link") +COPY --from=build --link /target/ / +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH" +WORKDIR $GOPATH diff --git a/1.23/bullseye/Dockerfile b/1.23/bullseye/Dockerfile new file mode 100644 index 00000000..43595506 --- /dev/null +++ b/1.23/bullseye/Dockerfile @@ -0,0 +1,130 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM buildpack-deps:bullseye-scm AS build + +ENV PATH /usr/local/go/bin:$PATH + +ENV GOLANG_VERSION 1.23.10 + +RUN set -eux; \ + now="$(date '+%s')"; \ + arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ + url=; \ + case "$arch" in \ + 'amd64') \ + url='https://dl.google.com/go/go1.23.10.linux-amd64.tar.gz'; \ + sha256='535f9f81802499f2a7dbfa70abb8fda3793725fcc29460f719815f6e10b5fd60'; \ + ;; \ + 'armhf') \ + url='https://dl.google.com/go/go1.23.10.linux-armv6l.tar.gz'; \ + sha256='b6e00c9a72406d394b9f167e74670e28b72ed559cca8115b21be1cb9d5316cb4'; \ + ;; \ + 'arm64') \ + url='https://dl.google.com/go/go1.23.10.linux-arm64.tar.gz'; \ + sha256='bfb1f1df7173f44648ee070a39ab0481068632f595305a699d89cd56a33b8081'; \ + ;; \ + 'i386') \ + url='https://dl.google.com/go/go1.23.10.linux-386.tar.gz'; \ + sha256='ded3c0a8d6d2a0ea5e7599c49678efa05cda139d31baaaf7d8d536a9e4cc19b2'; \ + ;; \ + 'mips64el') \ + url='https://dl.google.com/go/go1.23.10.linux-mips64le.tar.gz'; \ + sha256='3d9a542d761877bcf46ad7ae900460a6d3d50f4a3691a40c8535128addf45a11'; \ + ;; \ + 'ppc64el') \ + url='https://dl.google.com/go/go1.23.10.linux-ppc64le.tar.gz'; \ + sha256='8fb94455cfa5e9a5e8af2bfbc7323a6fed2dabaffda1a69dae5dd41b669bbb57'; \ + ;; \ + 'riscv64') \ + url='https://dl.google.com/go/go1.23.10.linux-riscv64.tar.gz'; \ + sha256='ed68dbd165b2d2bf3725239a5bad852493b0de8ea45fa7a585159a63e0e1194a'; \ + ;; \ + 's390x') \ + url='https://dl.google.com/go/go1.23.10.linux-s390x.tar.gz'; \ + sha256='7d0e8651eb54fce5cfe2d4b412ddfa50144ce21907f72192a6549ffe03db4e1f'; \ + ;; \ + *) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \ + esac; \ + \ + wget -O go.tgz.asc "$url.asc"; \ + wget -O go.tgz "$url" --progress=dot:giga; \ + echo "$sha256 *go.tgz" | sha256sum -c -; \ + \ +# https://github.com/golang/go/issues/14739#issuecomment-324767697 + GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ +# https://www.google.com/linuxrepositories/ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \ +# let's also fetch the specific subkey of that key explicitly that we expect "go.tgz.asc" to be signed by, just to make sure we definitely have it + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys '2F52 8D36 D67B 69ED F998 D857 78BD 6547 3CB3 BD13'; \ + gpg --batch --verify go.tgz.asc go.tgz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME" go.tgz.asc; \ + \ + tar -C /usr/local -xzf go.tgz; \ + rm go.tgz; \ + \ +# save the timestamp from the tarball so we can restore it for reproducibility, if necessary (see below) + SOURCE_DATE_EPOCH="$(stat -c '%Y' /usr/local/go)"; \ + export SOURCE_DATE_EPOCH; \ + touchy="$(date -d "@$SOURCE_DATE_EPOCH" '+%Y%m%d%H%M.%S')"; \ +# for logging validation/edification + date --date "@$SOURCE_DATE_EPOCH" --rfc-2822; \ +# sanity check (detected value should be older than our wall clock) + [ "$SOURCE_DATE_EPOCH" -lt "$now" ]; \ + \ + if [ "$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' ]; \ +# (re-)clamp timestamp for reproducibility (allows "COPY --link" to be more clever/useful) + touch -t "$touchy" /usr/local/go/go.env /usr/local/go; \ + fi; \ + \ +# ideally at this point, we would just "COPY --link ... /usr/local/go/ /usr/local/go/" but BuildKit insists on creating the parent directories (perhaps related to https://github.com/opencontainers/image-spec/pull/970), and does so with unreproducible timestamps, so we instead create a whole new "directory tree" that we can "COPY --link" to accomplish what we want + mkdir /target /target/usr /target/usr/local; \ + mv -vT /usr/local/go /target/usr/local/go; \ + ln -svfT /target/usr/local/go /usr/local/go; \ + touch -t "$touchy" /target/usr/local /target/usr /target; \ + \ +# smoke test + go version; \ +# make sure our reproducibile timestamp is probably still correct (best-effort inline reproducibility test) + epoch="$(stat -c '%Y' /target/usr/local/go)"; \ + [ "$SOURCE_DATE_EPOCH" = "$epoch" ]; \ + find /target -newer /target/usr/local/go -exec sh -c 'ls -ld "$@" && exit "$#"' -- '{}' + + +FROM buildpack-deps:bullseye-scm + +# install cgo-related dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + g++ \ + gcc \ + libc6-dev \ + make \ + pkg-config \ + ; \ + rm -rf /var/lib/apt/lists/* + +ENV GOLANG_VERSION 1.23.10 + +# don't auto-upgrade the gotoolchain +# https://github.com/docker-library/golang/issues/472 +ENV GOTOOLCHAIN=local + +ENV GOPATH /go +ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH +# (see notes above about "COPY --link") +COPY --from=build --link /target/ / +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH" +WORKDIR $GOPATH diff --git a/1.20/windows/nanoserver-ltsc2022/Dockerfile b/1.23/windows/nanoserver-ltsc2022/Dockerfile similarity index 92% rename from 1.20/windows/nanoserver-ltsc2022/Dockerfile rename to 1.23/windows/nanoserver-ltsc2022/Dockerfile index 4eb7bdcc..913f7a93 100644 --- a/1.20/windows/nanoserver-ltsc2022/Dockerfile +++ b/1.23/windows/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.11 +ENV GOLANG_VERSION 1.23.10 # Docker's Windows path parsing is absolutely *cursed*; please just trust me on this one -Tianon -COPY --from=golang:1.20.11-windowsservercore-ltsc2022 ["C:\\\\Program Files\\\\Go","C:\\\\Program Files\\\\Go"] +COPY --from=golang:1.23.10-windowsservercore-ltsc2022 ["C:\\\\Program Files\\\\Go","C:\\\\Program Files\\\\Go"] RUN go version WORKDIR $GOPATH diff --git a/1.21/windows/nanoserver-1809/Dockerfile b/1.23/windows/nanoserver-ltsc2025/Dockerfile similarity index 84% rename from 1.21/windows/nanoserver-1809/Dockerfile rename to 1.23/windows/nanoserver-ltsc2025/Dockerfile index 607ab7f7..1fd2296d 100644 --- a/1.21/windows/nanoserver-1809/Dockerfile +++ b/1.23/windows/nanoserver-ltsc2025/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM mcr.microsoft.com/windows/nanoserver:1809 +FROM mcr.microsoft.com/windows/nanoserver:ltsc2025 SHELL ["cmd", "/S", "/C"] @@ -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.21.4 +ENV GOLANG_VERSION 1.23.10 # Docker's Windows path parsing is absolutely *cursed*; please just trust me on this one -Tianon -COPY --from=golang:1.21.4-windowsservercore-1809 ["C:\\\\Program Files\\\\Go","C:\\\\Program Files\\\\Go"] +COPY --from=golang:1.23.10-windowsservercore-ltsc2025 ["C:\\\\Program Files\\\\Go","C:\\\\Program Files\\\\Go"] RUN go version WORKDIR $GOPATH diff --git a/1.20/windows/windowsservercore-ltsc2022/Dockerfile b/1.23/windows/windowsservercore-ltsc2022/Dockerfile similarity index 85% rename from 1.20/windows/windowsservercore-ltsc2022/Dockerfile rename to 1.23/windows/windowsservercore-ltsc2022/Dockerfile index de84d9a6..1c54378e 100644 --- a/1.20/windows/windowsservercore-ltsc2022/Dockerfile +++ b/1.23/windows/windowsservercore-ltsc2022/Dockerfile @@ -10,13 +10,14 @@ FROM mcr.microsoft.com/windows/servercore:ltsc2022 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] # install MinGit (especially for "go get") -# https://blogs.msdn.microsoft.com/visualstudioalm/2016/09/03/whats-new-in-git-for-windows-2-10/ -# "Essentially, it is a Git for Windows that was stripped down as much as possible without sacrificing the functionality in which 3rd-party software may be interested." -# "It currently requires only ~45MB on disk." -ENV GIT_VERSION 2.23.0 +# https://github.com/git-for-windows/git/wiki/MinGit +# https://gitforwindows.org/ +# https://github.com/git-for-windows/git/releases +# TODO in some future release, consider the BusyBox variant? maybe only once https://github.com/git-for-windows/git/issues/1439 is officially closed? +ENV GIT_VERSION 2.48.1 ENV GIT_TAG v${GIT_VERSION}.windows.1 ENV GIT_DOWNLOAD_URL https://github.com/git-for-windows/git/releases/download/${GIT_TAG}/MinGit-${GIT_VERSION}-64-bit.zip -ENV GIT_DOWNLOAD_SHA256 8f65208f92c0b4c3ae4c0cf02d4b5f6791d539cd1a07b2df62b7116467724735 +ENV GIT_DOWNLOAD_SHA256 11e8f462726827acccc7ecdad541f2544cbe5506d70fef4fa1ffac7c16288709 # steps inspired by "chcolateyInstall.ps1" from "git.install" (https://chocolatey.org/packages/git.install) RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ @@ -42,6 +43,9 @@ RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \ git version; \ \ Write-Host 'Complete.'; +# https://blogs.msdn.microsoft.com/visualstudioalm/2016/09/03/whats-new-in-git-for-windows-2-10/ +# "Essentially, it is a Git for Windows that was stripped down as much as possible without sacrificing the functionality in which 3rd-party software may be interested." +# "It currently requires only ~45MB on disk." # for 1.17+, we'll follow the (new) Go upstream default for install (https://golang.org/cl/283600), which frees up C:\go to be the default GOPATH and thus match the Linux images more closely (https://github.com/docker-library/golang/issues/288) ENV GOPATH C:\\go @@ -53,14 +57,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.11 +ENV GOLANG_VERSION 1.23.10 -RUN $url = 'https://dl.google.com/go/go1.20.11.windows-amd64.zip'; \ +RUN $url = 'https://dl.google.com/go/go1.23.10.windows-amd64.zip'; \ Write-Host ('Downloading {0} ...' -f $url); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ Invoke-WebRequest -Uri $url -OutFile 'go.zip'; \ \ - $sha256 = '53bbae25fb40e316c2e7752be842d9825e3d85e2f33d349cb8b28c5cb747bf3e'; \ + $sha256 = '3b533bbe63e73732bf19b8facc9160417e97d13eb174dfe58a213c6d0dee0010'; \ Write-Host ('Verifying sha256 ({0}) ...' -f $sha256); \ if ((Get-FileHash go.zip -Algorithm sha256).Hash -ne $sha256) { \ Write-Host 'FAILED!'; \ diff --git a/1.20/windows/windowsservercore-1809/Dockerfile b/1.23/windows/windowsservercore-ltsc2025/Dockerfile similarity index 84% rename from 1.20/windows/windowsservercore-1809/Dockerfile rename to 1.23/windows/windowsservercore-ltsc2025/Dockerfile index d7ce7861..a37e03a9 100644 --- a/1.20/windows/windowsservercore-1809/Dockerfile +++ b/1.23/windows/windowsservercore-ltsc2025/Dockerfile @@ -4,19 +4,20 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM mcr.microsoft.com/windows/servercore:1809 +FROM mcr.microsoft.com/windows/servercore:ltsc2025 # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] # install MinGit (especially for "go get") -# https://blogs.msdn.microsoft.com/visualstudioalm/2016/09/03/whats-new-in-git-for-windows-2-10/ -# "Essentially, it is a Git for Windows that was stripped down as much as possible without sacrificing the functionality in which 3rd-party software may be interested." -# "It currently requires only ~45MB on disk." -ENV GIT_VERSION 2.23.0 +# https://github.com/git-for-windows/git/wiki/MinGit +# https://gitforwindows.org/ +# https://github.com/git-for-windows/git/releases +# TODO in some future release, consider the BusyBox variant? maybe only once https://github.com/git-for-windows/git/issues/1439 is officially closed? +ENV GIT_VERSION 2.48.1 ENV GIT_TAG v${GIT_VERSION}.windows.1 ENV GIT_DOWNLOAD_URL https://github.com/git-for-windows/git/releases/download/${GIT_TAG}/MinGit-${GIT_VERSION}-64-bit.zip -ENV GIT_DOWNLOAD_SHA256 8f65208f92c0b4c3ae4c0cf02d4b5f6791d539cd1a07b2df62b7116467724735 +ENV GIT_DOWNLOAD_SHA256 11e8f462726827acccc7ecdad541f2544cbe5506d70fef4fa1ffac7c16288709 # steps inspired by "chcolateyInstall.ps1" from "git.install" (https://chocolatey.org/packages/git.install) RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ @@ -42,6 +43,9 @@ RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \ git version; \ \ Write-Host 'Complete.'; +# https://blogs.msdn.microsoft.com/visualstudioalm/2016/09/03/whats-new-in-git-for-windows-2-10/ +# "Essentially, it is a Git for Windows that was stripped down as much as possible without sacrificing the functionality in which 3rd-party software may be interested." +# "It currently requires only ~45MB on disk." # for 1.17+, we'll follow the (new) Go upstream default for install (https://golang.org/cl/283600), which frees up C:\go to be the default GOPATH and thus match the Linux images more closely (https://github.com/docker-library/golang/issues/288) ENV GOPATH C:\\go @@ -53,14 +57,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.11 +ENV GOLANG_VERSION 1.23.10 -RUN $url = 'https://dl.google.com/go/go1.20.11.windows-amd64.zip'; \ +RUN $url = 'https://dl.google.com/go/go1.23.10.windows-amd64.zip'; \ Write-Host ('Downloading {0} ...' -f $url); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ Invoke-WebRequest -Uri $url -OutFile 'go.zip'; \ \ - $sha256 = '53bbae25fb40e316c2e7752be842d9825e3d85e2f33d349cb8b28c5cb747bf3e'; \ + $sha256 = '3b533bbe63e73732bf19b8facc9160417e97d13eb174dfe58a213c6d0dee0010'; \ Write-Host ('Verifying sha256 ({0}) ...' -f $sha256); \ if ((Get-FileHash go.zip -Algorithm sha256).Hash -ne $sha256) { \ Write-Host 'FAILED!'; \ diff --git a/1.24/alpine3.21/Dockerfile b/1.24/alpine3.21/Dockerfile new file mode 100644 index 00000000..2dacd033 --- /dev/null +++ b/1.24/alpine3.21/Dockerfile @@ -0,0 +1,128 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.21 AS build + +ENV PATH /usr/local/go/bin:$PATH + +ENV GOLANG_VERSION 1.24.4 + +RUN set -eux; \ + now="$(date '+%s')"; \ + apk add --no-cache --virtual .fetch-deps \ + ca-certificates \ + gnupg \ +# busybox's "tar" doesn't handle directory mtime correctly, so our SOURCE_DATE_EPOCH lookup doesn't work (the mtime of "/usr/local/go" always ends up being the extraction timestamp) + tar \ + ; \ + arch="$(apk --print-arch)"; \ + url=; \ + case "$arch" in \ + 'x86_64') \ + url='https://dl.google.com/go/go1.24.4.linux-amd64.tar.gz'; \ + sha256='77e5da33bb72aeaef1ba4418b6fe511bc4d041873cbf82e5aa6318740df98717'; \ + ;; \ + 'armhf') \ + url='https://dl.google.com/go/go1.24.4.linux-armv6l.tar.gz'; \ + sha256='6a554e32301cecae3162677e66d4264b81b3b1a89592dd1b7b5c552c7a49fe37'; \ + ;; \ + 'armv7') \ + url='https://dl.google.com/go/go1.24.4.linux-armv6l.tar.gz'; \ + sha256='6a554e32301cecae3162677e66d4264b81b3b1a89592dd1b7b5c552c7a49fe37'; \ + ;; \ + 'aarch64') \ + url='https://dl.google.com/go/go1.24.4.linux-arm64.tar.gz'; \ + sha256='d5501ee5aca0f258d5fe9bfaed401958445014495dc115f202d43d5210b45241'; \ + ;; \ + 'x86') \ + url='https://dl.google.com/go/go1.24.4.linux-386.tar.gz'; \ + sha256='130c9b061082eca15513e595e9952a2ded32e737e609dd0e49f7dfa74eba026d'; \ + ;; \ + 'ppc64le') \ + url='https://dl.google.com/go/go1.24.4.linux-ppc64le.tar.gz'; \ + sha256='9ca4afef813a2578c23843b640ae0290aa54b2e3c950a6cc4c99e16a57dec2ec'; \ + ;; \ + 'riscv64') \ + url='https://dl.google.com/go/go1.24.4.linux-riscv64.tar.gz'; \ + sha256='1d7034f98662d8f2c8abd7c700ada4093acb4f9c00e0e51a30344821d0785c77'; \ + ;; \ + 's390x') \ + url='https://dl.google.com/go/go1.24.4.linux-s390x.tar.gz'; \ + sha256='0449f3203c39703ab27684be763e9bb78ca9a051e0e4176727aead9461b6deb5'; \ + ;; \ + *) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \ + esac; \ + \ + wget -O go.tgz.asc "$url.asc"; \ + wget -O go.tgz "$url"; \ + echo "$sha256 *go.tgz" | sha256sum -c -; \ + \ +# https://github.com/golang/go/issues/14739#issuecomment-324767697 + GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ +# https://www.google.com/linuxrepositories/ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \ +# let's also fetch the specific subkey of that key explicitly that we expect "go.tgz.asc" to be signed by, just to make sure we definitely have it + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys '2F52 8D36 D67B 69ED F998 D857 78BD 6547 3CB3 BD13'; \ + gpg --batch --verify go.tgz.asc go.tgz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME" go.tgz.asc; \ + \ + tar -C /usr/local -xzf go.tgz; \ + rm go.tgz; \ + \ +# save the timestamp from the tarball so we can restore it for reproducibility, if necessary (see below) + SOURCE_DATE_EPOCH="$(stat -c '%Y' /usr/local/go)"; \ + export SOURCE_DATE_EPOCH; \ + touchy="$(date -d "@$SOURCE_DATE_EPOCH" '+%Y%m%d%H%M.%S')"; \ +# for logging validation/edification + date --date "@$SOURCE_DATE_EPOCH" --rfc-2822; \ +# sanity check (detected value should be older than our wall clock) + [ "$SOURCE_DATE_EPOCH" -lt "$now" ]; \ + \ + if [ "$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' ]; \ +# (re-)clamp timestamp for reproducibility (allows "COPY --link" to be more clever/useful) + touch -t "$touchy" /usr/local/go/go.env /usr/local/go; \ + fi; \ + \ +# ideally at this point, we would just "COPY --link ... /usr/local/go/ /usr/local/go/" but BuildKit insists on creating the parent directories (perhaps related to https://github.com/opencontainers/image-spec/pull/970), and does so with unreproducible timestamps, so we instead create a whole new "directory tree" that we can "COPY --link" to accomplish what we want + mkdir /target /target/usr /target/usr/local; \ + mv -vT /usr/local/go /target/usr/local/go; \ + ln -svfT /target/usr/local/go /usr/local/go; \ + touch -t "$touchy" /target/usr/local /target/usr /target; \ + \ + apk del --no-network .fetch-deps; \ + \ +# smoke test + go version; \ +# make sure our reproducibile timestamp is probably still correct (best-effort inline reproducibility test) + epoch="$(stat -c '%Y' /target/usr/local/go)"; \ + [ "$SOURCE_DATE_EPOCH" = "$epoch" ]; \ + find /target -newer /target/usr/local/go -exec sh -c 'ls -ld "$@" && exit "$#"' -- '{}' + + +FROM alpine:3.21 + +RUN apk add --no-cache ca-certificates + +ENV GOLANG_VERSION 1.24.4 + +# don't auto-upgrade the gotoolchain +# https://github.com/docker-library/golang/issues/472 +ENV GOTOOLCHAIN=local + +ENV GOPATH /go +ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH +# (see notes above about "COPY --link") +COPY --from=build --link /target/ / +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH" +WORKDIR $GOPATH diff --git a/1.24/alpine3.22/Dockerfile b/1.24/alpine3.22/Dockerfile new file mode 100644 index 00000000..2b970d15 --- /dev/null +++ b/1.24/alpine3.22/Dockerfile @@ -0,0 +1,128 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.22 AS build + +ENV PATH /usr/local/go/bin:$PATH + +ENV GOLANG_VERSION 1.24.4 + +RUN set -eux; \ + now="$(date '+%s')"; \ + apk add --no-cache --virtual .fetch-deps \ + ca-certificates \ + gnupg \ +# busybox's "tar" doesn't handle directory mtime correctly, so our SOURCE_DATE_EPOCH lookup doesn't work (the mtime of "/usr/local/go" always ends up being the extraction timestamp) + tar \ + ; \ + arch="$(apk --print-arch)"; \ + url=; \ + case "$arch" in \ + 'x86_64') \ + url='https://dl.google.com/go/go1.24.4.linux-amd64.tar.gz'; \ + sha256='77e5da33bb72aeaef1ba4418b6fe511bc4d041873cbf82e5aa6318740df98717'; \ + ;; \ + 'armhf') \ + url='https://dl.google.com/go/go1.24.4.linux-armv6l.tar.gz'; \ + sha256='6a554e32301cecae3162677e66d4264b81b3b1a89592dd1b7b5c552c7a49fe37'; \ + ;; \ + 'armv7') \ + url='https://dl.google.com/go/go1.24.4.linux-armv6l.tar.gz'; \ + sha256='6a554e32301cecae3162677e66d4264b81b3b1a89592dd1b7b5c552c7a49fe37'; \ + ;; \ + 'aarch64') \ + url='https://dl.google.com/go/go1.24.4.linux-arm64.tar.gz'; \ + sha256='d5501ee5aca0f258d5fe9bfaed401958445014495dc115f202d43d5210b45241'; \ + ;; \ + 'x86') \ + url='https://dl.google.com/go/go1.24.4.linux-386.tar.gz'; \ + sha256='130c9b061082eca15513e595e9952a2ded32e737e609dd0e49f7dfa74eba026d'; \ + ;; \ + 'ppc64le') \ + url='https://dl.google.com/go/go1.24.4.linux-ppc64le.tar.gz'; \ + sha256='9ca4afef813a2578c23843b640ae0290aa54b2e3c950a6cc4c99e16a57dec2ec'; \ + ;; \ + 'riscv64') \ + url='https://dl.google.com/go/go1.24.4.linux-riscv64.tar.gz'; \ + sha256='1d7034f98662d8f2c8abd7c700ada4093acb4f9c00e0e51a30344821d0785c77'; \ + ;; \ + 's390x') \ + url='https://dl.google.com/go/go1.24.4.linux-s390x.tar.gz'; \ + sha256='0449f3203c39703ab27684be763e9bb78ca9a051e0e4176727aead9461b6deb5'; \ + ;; \ + *) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \ + esac; \ + \ + wget -O go.tgz.asc "$url.asc"; \ + wget -O go.tgz "$url"; \ + echo "$sha256 *go.tgz" | sha256sum -c -; \ + \ +# https://github.com/golang/go/issues/14739#issuecomment-324767697 + GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ +# https://www.google.com/linuxrepositories/ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \ +# let's also fetch the specific subkey of that key explicitly that we expect "go.tgz.asc" to be signed by, just to make sure we definitely have it + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys '2F52 8D36 D67B 69ED F998 D857 78BD 6547 3CB3 BD13'; \ + gpg --batch --verify go.tgz.asc go.tgz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME" go.tgz.asc; \ + \ + tar -C /usr/local -xzf go.tgz; \ + rm go.tgz; \ + \ +# save the timestamp from the tarball so we can restore it for reproducibility, if necessary (see below) + SOURCE_DATE_EPOCH="$(stat -c '%Y' /usr/local/go)"; \ + export SOURCE_DATE_EPOCH; \ + touchy="$(date -d "@$SOURCE_DATE_EPOCH" '+%Y%m%d%H%M.%S')"; \ +# for logging validation/edification + date --date "@$SOURCE_DATE_EPOCH" --rfc-2822; \ +# sanity check (detected value should be older than our wall clock) + [ "$SOURCE_DATE_EPOCH" -lt "$now" ]; \ + \ + if [ "$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' ]; \ +# (re-)clamp timestamp for reproducibility (allows "COPY --link" to be more clever/useful) + touch -t "$touchy" /usr/local/go/go.env /usr/local/go; \ + fi; \ + \ +# ideally at this point, we would just "COPY --link ... /usr/local/go/ /usr/local/go/" but BuildKit insists on creating the parent directories (perhaps related to https://github.com/opencontainers/image-spec/pull/970), and does so with unreproducible timestamps, so we instead create a whole new "directory tree" that we can "COPY --link" to accomplish what we want + mkdir /target /target/usr /target/usr/local; \ + mv -vT /usr/local/go /target/usr/local/go; \ + ln -svfT /target/usr/local/go /usr/local/go; \ + touch -t "$touchy" /target/usr/local /target/usr /target; \ + \ + apk del --no-network .fetch-deps; \ + \ +# smoke test + go version; \ +# make sure our reproducibile timestamp is probably still correct (best-effort inline reproducibility test) + epoch="$(stat -c '%Y' /target/usr/local/go)"; \ + [ "$SOURCE_DATE_EPOCH" = "$epoch" ]; \ + find /target -newer /target/usr/local/go -exec sh -c 'ls -ld "$@" && exit "$#"' -- '{}' + + +FROM alpine:3.22 + +RUN apk add --no-cache ca-certificates + +ENV GOLANG_VERSION 1.24.4 + +# don't auto-upgrade the gotoolchain +# https://github.com/docker-library/golang/issues/472 +ENV GOTOOLCHAIN=local + +ENV GOPATH /go +ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH +# (see notes above about "COPY --link") +COPY --from=build --link /target/ / +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH" +WORKDIR $GOPATH diff --git a/1.24/bookworm/Dockerfile b/1.24/bookworm/Dockerfile new file mode 100644 index 00000000..d8969aa0 --- /dev/null +++ b/1.24/bookworm/Dockerfile @@ -0,0 +1,130 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM buildpack-deps:bookworm-scm AS build + +ENV PATH /usr/local/go/bin:$PATH + +ENV GOLANG_VERSION 1.24.4 + +RUN set -eux; \ + now="$(date '+%s')"; \ + arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ + url=; \ + case "$arch" in \ + 'amd64') \ + url='https://dl.google.com/go/go1.24.4.linux-amd64.tar.gz'; \ + sha256='77e5da33bb72aeaef1ba4418b6fe511bc4d041873cbf82e5aa6318740df98717'; \ + ;; \ + 'armhf') \ + url='https://dl.google.com/go/go1.24.4.linux-armv6l.tar.gz'; \ + sha256='6a554e32301cecae3162677e66d4264b81b3b1a89592dd1b7b5c552c7a49fe37'; \ + ;; \ + 'arm64') \ + url='https://dl.google.com/go/go1.24.4.linux-arm64.tar.gz'; \ + sha256='d5501ee5aca0f258d5fe9bfaed401958445014495dc115f202d43d5210b45241'; \ + ;; \ + 'i386') \ + url='https://dl.google.com/go/go1.24.4.linux-386.tar.gz'; \ + sha256='130c9b061082eca15513e595e9952a2ded32e737e609dd0e49f7dfa74eba026d'; \ + ;; \ + 'mips64el') \ + url='https://dl.google.com/go/go1.24.4.linux-mips64le.tar.gz'; \ + sha256='fa763d8673f94d6e534bb72c3cf675d4c2b8da4a6da42a89f08c5586106db39c'; \ + ;; \ + 'ppc64el') \ + url='https://dl.google.com/go/go1.24.4.linux-ppc64le.tar.gz'; \ + sha256='9ca4afef813a2578c23843b640ae0290aa54b2e3c950a6cc4c99e16a57dec2ec'; \ + ;; \ + 'riscv64') \ + url='https://dl.google.com/go/go1.24.4.linux-riscv64.tar.gz'; \ + sha256='1d7034f98662d8f2c8abd7c700ada4093acb4f9c00e0e51a30344821d0785c77'; \ + ;; \ + 's390x') \ + url='https://dl.google.com/go/go1.24.4.linux-s390x.tar.gz'; \ + sha256='0449f3203c39703ab27684be763e9bb78ca9a051e0e4176727aead9461b6deb5'; \ + ;; \ + *) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \ + esac; \ + \ + wget -O go.tgz.asc "$url.asc"; \ + wget -O go.tgz "$url" --progress=dot:giga; \ + echo "$sha256 *go.tgz" | sha256sum -c -; \ + \ +# https://github.com/golang/go/issues/14739#issuecomment-324767697 + GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ +# https://www.google.com/linuxrepositories/ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \ +# let's also fetch the specific subkey of that key explicitly that we expect "go.tgz.asc" to be signed by, just to make sure we definitely have it + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys '2F52 8D36 D67B 69ED F998 D857 78BD 6547 3CB3 BD13'; \ + gpg --batch --verify go.tgz.asc go.tgz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME" go.tgz.asc; \ + \ + tar -C /usr/local -xzf go.tgz; \ + rm go.tgz; \ + \ +# save the timestamp from the tarball so we can restore it for reproducibility, if necessary (see below) + SOURCE_DATE_EPOCH="$(stat -c '%Y' /usr/local/go)"; \ + export SOURCE_DATE_EPOCH; \ + touchy="$(date -d "@$SOURCE_DATE_EPOCH" '+%Y%m%d%H%M.%S')"; \ +# for logging validation/edification + date --date "@$SOURCE_DATE_EPOCH" --rfc-2822; \ +# sanity check (detected value should be older than our wall clock) + [ "$SOURCE_DATE_EPOCH" -lt "$now" ]; \ + \ + if [ "$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' ]; \ +# (re-)clamp timestamp for reproducibility (allows "COPY --link" to be more clever/useful) + touch -t "$touchy" /usr/local/go/go.env /usr/local/go; \ + fi; \ + \ +# ideally at this point, we would just "COPY --link ... /usr/local/go/ /usr/local/go/" but BuildKit insists on creating the parent directories (perhaps related to https://github.com/opencontainers/image-spec/pull/970), and does so with unreproducible timestamps, so we instead create a whole new "directory tree" that we can "COPY --link" to accomplish what we want + mkdir /target /target/usr /target/usr/local; \ + mv -vT /usr/local/go /target/usr/local/go; \ + ln -svfT /target/usr/local/go /usr/local/go; \ + touch -t "$touchy" /target/usr/local /target/usr /target; \ + \ +# smoke test + go version; \ +# make sure our reproducibile timestamp is probably still correct (best-effort inline reproducibility test) + epoch="$(stat -c '%Y' /target/usr/local/go)"; \ + [ "$SOURCE_DATE_EPOCH" = "$epoch" ]; \ + find /target -newer /target/usr/local/go -exec sh -c 'ls -ld "$@" && exit "$#"' -- '{}' + + +FROM buildpack-deps:bookworm-scm + +# install cgo-related dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + g++ \ + gcc \ + libc6-dev \ + make \ + pkg-config \ + ; \ + rm -rf /var/lib/apt/lists/* + +ENV GOLANG_VERSION 1.24.4 + +# don't auto-upgrade the gotoolchain +# https://github.com/docker-library/golang/issues/472 +ENV GOTOOLCHAIN=local + +ENV GOPATH /go +ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH +# (see notes above about "COPY --link") +COPY --from=build --link /target/ / +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH" +WORKDIR $GOPATH diff --git a/1.24/bullseye/Dockerfile b/1.24/bullseye/Dockerfile new file mode 100644 index 00000000..d72cd34d --- /dev/null +++ b/1.24/bullseye/Dockerfile @@ -0,0 +1,130 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM buildpack-deps:bullseye-scm AS build + +ENV PATH /usr/local/go/bin:$PATH + +ENV GOLANG_VERSION 1.24.4 + +RUN set -eux; \ + now="$(date '+%s')"; \ + arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ + url=; \ + case "$arch" in \ + 'amd64') \ + url='https://dl.google.com/go/go1.24.4.linux-amd64.tar.gz'; \ + sha256='77e5da33bb72aeaef1ba4418b6fe511bc4d041873cbf82e5aa6318740df98717'; \ + ;; \ + 'armhf') \ + url='https://dl.google.com/go/go1.24.4.linux-armv6l.tar.gz'; \ + sha256='6a554e32301cecae3162677e66d4264b81b3b1a89592dd1b7b5c552c7a49fe37'; \ + ;; \ + 'arm64') \ + url='https://dl.google.com/go/go1.24.4.linux-arm64.tar.gz'; \ + sha256='d5501ee5aca0f258d5fe9bfaed401958445014495dc115f202d43d5210b45241'; \ + ;; \ + 'i386') \ + url='https://dl.google.com/go/go1.24.4.linux-386.tar.gz'; \ + sha256='130c9b061082eca15513e595e9952a2ded32e737e609dd0e49f7dfa74eba026d'; \ + ;; \ + 'mips64el') \ + url='https://dl.google.com/go/go1.24.4.linux-mips64le.tar.gz'; \ + sha256='fa763d8673f94d6e534bb72c3cf675d4c2b8da4a6da42a89f08c5586106db39c'; \ + ;; \ + 'ppc64el') \ + url='https://dl.google.com/go/go1.24.4.linux-ppc64le.tar.gz'; \ + sha256='9ca4afef813a2578c23843b640ae0290aa54b2e3c950a6cc4c99e16a57dec2ec'; \ + ;; \ + 'riscv64') \ + url='https://dl.google.com/go/go1.24.4.linux-riscv64.tar.gz'; \ + sha256='1d7034f98662d8f2c8abd7c700ada4093acb4f9c00e0e51a30344821d0785c77'; \ + ;; \ + 's390x') \ + url='https://dl.google.com/go/go1.24.4.linux-s390x.tar.gz'; \ + sha256='0449f3203c39703ab27684be763e9bb78ca9a051e0e4176727aead9461b6deb5'; \ + ;; \ + *) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \ + esac; \ + \ + wget -O go.tgz.asc "$url.asc"; \ + wget -O go.tgz "$url" --progress=dot:giga; \ + echo "$sha256 *go.tgz" | sha256sum -c -; \ + \ +# https://github.com/golang/go/issues/14739#issuecomment-324767697 + GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ +# https://www.google.com/linuxrepositories/ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \ +# let's also fetch the specific subkey of that key explicitly that we expect "go.tgz.asc" to be signed by, just to make sure we definitely have it + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys '2F52 8D36 D67B 69ED F998 D857 78BD 6547 3CB3 BD13'; \ + gpg --batch --verify go.tgz.asc go.tgz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME" go.tgz.asc; \ + \ + tar -C /usr/local -xzf go.tgz; \ + rm go.tgz; \ + \ +# save the timestamp from the tarball so we can restore it for reproducibility, if necessary (see below) + SOURCE_DATE_EPOCH="$(stat -c '%Y' /usr/local/go)"; \ + export SOURCE_DATE_EPOCH; \ + touchy="$(date -d "@$SOURCE_DATE_EPOCH" '+%Y%m%d%H%M.%S')"; \ +# for logging validation/edification + date --date "@$SOURCE_DATE_EPOCH" --rfc-2822; \ +# sanity check (detected value should be older than our wall clock) + [ "$SOURCE_DATE_EPOCH" -lt "$now" ]; \ + \ + if [ "$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' ]; \ +# (re-)clamp timestamp for reproducibility (allows "COPY --link" to be more clever/useful) + touch -t "$touchy" /usr/local/go/go.env /usr/local/go; \ + fi; \ + \ +# ideally at this point, we would just "COPY --link ... /usr/local/go/ /usr/local/go/" but BuildKit insists on creating the parent directories (perhaps related to https://github.com/opencontainers/image-spec/pull/970), and does so with unreproducible timestamps, so we instead create a whole new "directory tree" that we can "COPY --link" to accomplish what we want + mkdir /target /target/usr /target/usr/local; \ + mv -vT /usr/local/go /target/usr/local/go; \ + ln -svfT /target/usr/local/go /usr/local/go; \ + touch -t "$touchy" /target/usr/local /target/usr /target; \ + \ +# smoke test + go version; \ +# make sure our reproducibile timestamp is probably still correct (best-effort inline reproducibility test) + epoch="$(stat -c '%Y' /target/usr/local/go)"; \ + [ "$SOURCE_DATE_EPOCH" = "$epoch" ]; \ + find /target -newer /target/usr/local/go -exec sh -c 'ls -ld "$@" && exit "$#"' -- '{}' + + +FROM buildpack-deps:bullseye-scm + +# install cgo-related dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + g++ \ + gcc \ + libc6-dev \ + make \ + pkg-config \ + ; \ + rm -rf /var/lib/apt/lists/* + +ENV GOLANG_VERSION 1.24.4 + +# don't auto-upgrade the gotoolchain +# https://github.com/docker-library/golang/issues/472 +ENV GOTOOLCHAIN=local + +ENV GOPATH /go +ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH +# (see notes above about "COPY --link") +COPY --from=build --link /target/ / +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH" +WORKDIR $GOPATH diff --git a/1.21/windows/nanoserver-ltsc2022/Dockerfile b/1.24/windows/nanoserver-ltsc2022/Dockerfile similarity index 92% rename from 1.21/windows/nanoserver-ltsc2022/Dockerfile rename to 1.24/windows/nanoserver-ltsc2022/Dockerfile index 186ee716..65804c31 100644 --- a/1.21/windows/nanoserver-ltsc2022/Dockerfile +++ b/1.24/windows/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.21.4 +ENV GOLANG_VERSION 1.24.4 # Docker's Windows path parsing is absolutely *cursed*; please just trust me on this one -Tianon -COPY --from=golang:1.21.4-windowsservercore-ltsc2022 ["C:\\\\Program Files\\\\Go","C:\\\\Program Files\\\\Go"] +COPY --from=golang:1.24.4-windowsservercore-ltsc2022 ["C:\\\\Program Files\\\\Go","C:\\\\Program Files\\\\Go"] RUN go version WORKDIR $GOPATH diff --git a/1.20/windows/nanoserver-1809/Dockerfile b/1.24/windows/nanoserver-ltsc2025/Dockerfile similarity index 84% rename from 1.20/windows/nanoserver-1809/Dockerfile rename to 1.24/windows/nanoserver-ltsc2025/Dockerfile index 14918131..f3fece9a 100644 --- a/1.20/windows/nanoserver-1809/Dockerfile +++ b/1.24/windows/nanoserver-ltsc2025/Dockerfile @@ -4,7 +4,7 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM mcr.microsoft.com/windows/nanoserver:1809 +FROM mcr.microsoft.com/windows/nanoserver:ltsc2025 SHELL ["cmd", "/S", "/C"] @@ -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.11 +ENV GOLANG_VERSION 1.24.4 # Docker's Windows path parsing is absolutely *cursed*; please just trust me on this one -Tianon -COPY --from=golang:1.20.11-windowsservercore-1809 ["C:\\\\Program Files\\\\Go","C:\\\\Program Files\\\\Go"] +COPY --from=golang:1.24.4-windowsservercore-ltsc2025 ["C:\\\\Program Files\\\\Go","C:\\\\Program Files\\\\Go"] RUN go version WORKDIR $GOPATH diff --git a/1.21/windows/windowsservercore-ltsc2022/Dockerfile b/1.24/windows/windowsservercore-ltsc2022/Dockerfile similarity index 85% rename from 1.21/windows/windowsservercore-ltsc2022/Dockerfile rename to 1.24/windows/windowsservercore-ltsc2022/Dockerfile index 049b8c64..7e1736d3 100644 --- a/1.21/windows/windowsservercore-ltsc2022/Dockerfile +++ b/1.24/windows/windowsservercore-ltsc2022/Dockerfile @@ -10,13 +10,14 @@ FROM mcr.microsoft.com/windows/servercore:ltsc2022 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] # install MinGit (especially for "go get") -# https://blogs.msdn.microsoft.com/visualstudioalm/2016/09/03/whats-new-in-git-for-windows-2-10/ -# "Essentially, it is a Git for Windows that was stripped down as much as possible without sacrificing the functionality in which 3rd-party software may be interested." -# "It currently requires only ~45MB on disk." -ENV GIT_VERSION 2.23.0 +# https://github.com/git-for-windows/git/wiki/MinGit +# https://gitforwindows.org/ +# https://github.com/git-for-windows/git/releases +# TODO in some future release, consider the BusyBox variant? maybe only once https://github.com/git-for-windows/git/issues/1439 is officially closed? +ENV GIT_VERSION 2.48.1 ENV GIT_TAG v${GIT_VERSION}.windows.1 ENV GIT_DOWNLOAD_URL https://github.com/git-for-windows/git/releases/download/${GIT_TAG}/MinGit-${GIT_VERSION}-64-bit.zip -ENV GIT_DOWNLOAD_SHA256 8f65208f92c0b4c3ae4c0cf02d4b5f6791d539cd1a07b2df62b7116467724735 +ENV GIT_DOWNLOAD_SHA256 11e8f462726827acccc7ecdad541f2544cbe5506d70fef4fa1ffac7c16288709 # steps inspired by "chcolateyInstall.ps1" from "git.install" (https://chocolatey.org/packages/git.install) RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ @@ -42,6 +43,9 @@ RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \ git version; \ \ Write-Host 'Complete.'; +# https://blogs.msdn.microsoft.com/visualstudioalm/2016/09/03/whats-new-in-git-for-windows-2-10/ +# "Essentially, it is a Git for Windows that was stripped down as much as possible without sacrificing the functionality in which 3rd-party software may be interested." +# "It currently requires only ~45MB on disk." # for 1.17+, we'll follow the (new) Go upstream default for install (https://golang.org/cl/283600), which frees up C:\go to be the default GOPATH and thus match the Linux images more closely (https://github.com/docker-library/golang/issues/288) ENV GOPATH C:\\go @@ -53,14 +57,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.21.4 +ENV GOLANG_VERSION 1.24.4 -RUN $url = 'https://dl.google.com/go/go1.21.4.windows-amd64.zip'; \ +RUN $url = 'https://dl.google.com/go/go1.24.4.windows-amd64.zip'; \ Write-Host ('Downloading {0} ...' -f $url); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ Invoke-WebRequest -Uri $url -OutFile 'go.zip'; \ \ - $sha256 = '79e5428e068c912d9cfa6cd115c13549856ec689c1332eac17f5d6122e19d595'; \ + $sha256 = 'b751a1136cb9d8a2e7ebb22c538c4f02c09b98138c7c8bfb78a54a4566c013b1'; \ Write-Host ('Verifying sha256 ({0}) ...' -f $sha256); \ if ((Get-FileHash go.zip -Algorithm sha256).Hash -ne $sha256) { \ Write-Host 'FAILED!'; \ diff --git a/1.21/windows/windowsservercore-1809/Dockerfile b/1.24/windows/windowsservercore-ltsc2025/Dockerfile similarity index 84% rename from 1.21/windows/windowsservercore-1809/Dockerfile rename to 1.24/windows/windowsservercore-ltsc2025/Dockerfile index 1783429b..0c8617b3 100644 --- a/1.21/windows/windowsservercore-1809/Dockerfile +++ b/1.24/windows/windowsservercore-ltsc2025/Dockerfile @@ -4,19 +4,20 @@ # PLEASE DO NOT EDIT IT DIRECTLY. # -FROM mcr.microsoft.com/windows/servercore:1809 +FROM mcr.microsoft.com/windows/servercore:ltsc2025 # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] # install MinGit (especially for "go get") -# https://blogs.msdn.microsoft.com/visualstudioalm/2016/09/03/whats-new-in-git-for-windows-2-10/ -# "Essentially, it is a Git for Windows that was stripped down as much as possible without sacrificing the functionality in which 3rd-party software may be interested." -# "It currently requires only ~45MB on disk." -ENV GIT_VERSION 2.23.0 +# https://github.com/git-for-windows/git/wiki/MinGit +# https://gitforwindows.org/ +# https://github.com/git-for-windows/git/releases +# TODO in some future release, consider the BusyBox variant? maybe only once https://github.com/git-for-windows/git/issues/1439 is officially closed? +ENV GIT_VERSION 2.48.1 ENV GIT_TAG v${GIT_VERSION}.windows.1 ENV GIT_DOWNLOAD_URL https://github.com/git-for-windows/git/releases/download/${GIT_TAG}/MinGit-${GIT_VERSION}-64-bit.zip -ENV GIT_DOWNLOAD_SHA256 8f65208f92c0b4c3ae4c0cf02d4b5f6791d539cd1a07b2df62b7116467724735 +ENV GIT_DOWNLOAD_SHA256 11e8f462726827acccc7ecdad541f2544cbe5506d70fef4fa1ffac7c16288709 # steps inspired by "chcolateyInstall.ps1" from "git.install" (https://chocolatey.org/packages/git.install) RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ @@ -42,6 +43,9 @@ RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \ git version; \ \ Write-Host 'Complete.'; +# https://blogs.msdn.microsoft.com/visualstudioalm/2016/09/03/whats-new-in-git-for-windows-2-10/ +# "Essentially, it is a Git for Windows that was stripped down as much as possible without sacrificing the functionality in which 3rd-party software may be interested." +# "It currently requires only ~45MB on disk." # for 1.17+, we'll follow the (new) Go upstream default for install (https://golang.org/cl/283600), which frees up C:\go to be the default GOPATH and thus match the Linux images more closely (https://github.com/docker-library/golang/issues/288) ENV GOPATH C:\\go @@ -53,14 +57,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.21.4 +ENV GOLANG_VERSION 1.24.4 -RUN $url = 'https://dl.google.com/go/go1.21.4.windows-amd64.zip'; \ +RUN $url = 'https://dl.google.com/go/go1.24.4.windows-amd64.zip'; \ Write-Host ('Downloading {0} ...' -f $url); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ Invoke-WebRequest -Uri $url -OutFile 'go.zip'; \ \ - $sha256 = '79e5428e068c912d9cfa6cd115c13549856ec689c1332eac17f5d6122e19d595'; \ + $sha256 = 'b751a1136cb9d8a2e7ebb22c538c4f02c09b98138c7c8bfb78a54a4566c013b1'; \ Write-Host ('Verifying sha256 ({0}) ...' -f $sha256); \ if ((Get-FileHash go.zip -Algorithm sha256).Hash -ne $sha256) { \ Write-Host 'FAILED!'; \ diff --git a/1.25-rc/alpine3.21/Dockerfile b/1.25-rc/alpine3.21/Dockerfile new file mode 100644 index 00000000..537ad783 --- /dev/null +++ b/1.25-rc/alpine3.21/Dockerfile @@ -0,0 +1,128 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.21 AS build + +ENV PATH /usr/local/go/bin:$PATH + +ENV GOLANG_VERSION 1.25rc1 + +RUN set -eux; \ + now="$(date '+%s')"; \ + apk add --no-cache --virtual .fetch-deps \ + ca-certificates \ + gnupg \ +# busybox's "tar" doesn't handle directory mtime correctly, so our SOURCE_DATE_EPOCH lookup doesn't work (the mtime of "/usr/local/go" always ends up being the extraction timestamp) + tar \ + ; \ + arch="$(apk --print-arch)"; \ + url=; \ + case "$arch" in \ + 'x86_64') \ + url='https://dl.google.com/go/go1.25rc1.linux-amd64.tar.gz'; \ + sha256='7588a720e243e4672e0dc1c7942ec7592d480a80440fa2829be8b22c9c44a5b7'; \ + ;; \ + 'armhf') \ + url='https://dl.google.com/go/go1.25rc1.linux-armv6l.tar.gz'; \ + sha256='96a18398bc2bbbb2a144e0f30c431a1508351d43c1b1194c7647ca4a967dbc69'; \ + ;; \ + 'armv7') \ + url='https://dl.google.com/go/go1.25rc1.linux-armv6l.tar.gz'; \ + sha256='96a18398bc2bbbb2a144e0f30c431a1508351d43c1b1194c7647ca4a967dbc69'; \ + ;; \ + 'aarch64') \ + url='https://dl.google.com/go/go1.25rc1.linux-arm64.tar.gz'; \ + sha256='ee0b82bc1421c66f3f322a214218b423beddb64182e0105dbff142e777e96fc1'; \ + ;; \ + 'x86') \ + url='https://dl.google.com/go/go1.25rc1.linux-386.tar.gz'; \ + sha256='4fb3aee891b70edee4423fb457546a30341a7b112c38594af4ee5f6db77ac376'; \ + ;; \ + 'ppc64le') \ + url='https://dl.google.com/go/go1.25rc1.linux-ppc64le.tar.gz'; \ + sha256='1ffd0793a1288854e73096c673597854d30d065f18dc5803f39b8c729aa65f7b'; \ + ;; \ + 'riscv64') \ + url='https://dl.google.com/go/go1.25rc1.linux-riscv64.tar.gz'; \ + sha256='3e5fbc8fdc44a8bbd1b2393a6cc369eb6f43f99d424e0b01b1e38977989239fd'; \ + ;; \ + 's390x') \ + url='https://dl.google.com/go/go1.25rc1.linux-s390x.tar.gz'; \ + sha256='bfcea7cc93ab874185ef6c66a66dacc34ab01dbd03c4d0e5aad3d360c1a6c324'; \ + ;; \ + *) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \ + esac; \ + \ + wget -O go.tgz.asc "$url.asc"; \ + wget -O go.tgz "$url"; \ + echo "$sha256 *go.tgz" | sha256sum -c -; \ + \ +# https://github.com/golang/go/issues/14739#issuecomment-324767697 + GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ +# https://www.google.com/linuxrepositories/ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \ +# let's also fetch the specific subkey of that key explicitly that we expect "go.tgz.asc" to be signed by, just to make sure we definitely have it + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys '2F52 8D36 D67B 69ED F998 D857 78BD 6547 3CB3 BD13'; \ + gpg --batch --verify go.tgz.asc go.tgz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME" go.tgz.asc; \ + \ + tar -C /usr/local -xzf go.tgz; \ + rm go.tgz; \ + \ +# save the timestamp from the tarball so we can restore it for reproducibility, if necessary (see below) + SOURCE_DATE_EPOCH="$(stat -c '%Y' /usr/local/go)"; \ + export SOURCE_DATE_EPOCH; \ + touchy="$(date -d "@$SOURCE_DATE_EPOCH" '+%Y%m%d%H%M.%S')"; \ +# for logging validation/edification + date --date "@$SOURCE_DATE_EPOCH" --rfc-2822; \ +# sanity check (detected value should be older than our wall clock) + [ "$SOURCE_DATE_EPOCH" -lt "$now" ]; \ + \ + if [ "$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' ]; \ +# (re-)clamp timestamp for reproducibility (allows "COPY --link" to be more clever/useful) + touch -t "$touchy" /usr/local/go/go.env /usr/local/go; \ + fi; \ + \ +# ideally at this point, we would just "COPY --link ... /usr/local/go/ /usr/local/go/" but BuildKit insists on creating the parent directories (perhaps related to https://github.com/opencontainers/image-spec/pull/970), and does so with unreproducible timestamps, so we instead create a whole new "directory tree" that we can "COPY --link" to accomplish what we want + mkdir /target /target/usr /target/usr/local; \ + mv -vT /usr/local/go /target/usr/local/go; \ + ln -svfT /target/usr/local/go /usr/local/go; \ + touch -t "$touchy" /target/usr/local /target/usr /target; \ + \ + apk del --no-network .fetch-deps; \ + \ +# smoke test + go version; \ +# make sure our reproducibile timestamp is probably still correct (best-effort inline reproducibility test) + epoch="$(stat -c '%Y' /target/usr/local/go)"; \ + [ "$SOURCE_DATE_EPOCH" = "$epoch" ]; \ + find /target -newer /target/usr/local/go -exec sh -c 'ls -ld "$@" && exit "$#"' -- '{}' + + +FROM alpine:3.21 + +RUN apk add --no-cache ca-certificates + +ENV GOLANG_VERSION 1.25rc1 + +# don't auto-upgrade the gotoolchain +# https://github.com/docker-library/golang/issues/472 +ENV GOTOOLCHAIN=local + +ENV GOPATH /go +ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH +# (see notes above about "COPY --link") +COPY --from=build --link /target/ / +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH" +WORKDIR $GOPATH diff --git a/1.25-rc/alpine3.22/Dockerfile b/1.25-rc/alpine3.22/Dockerfile new file mode 100644 index 00000000..c2f18b75 --- /dev/null +++ b/1.25-rc/alpine3.22/Dockerfile @@ -0,0 +1,128 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.22 AS build + +ENV PATH /usr/local/go/bin:$PATH + +ENV GOLANG_VERSION 1.25rc1 + +RUN set -eux; \ + now="$(date '+%s')"; \ + apk add --no-cache --virtual .fetch-deps \ + ca-certificates \ + gnupg \ +# busybox's "tar" doesn't handle directory mtime correctly, so our SOURCE_DATE_EPOCH lookup doesn't work (the mtime of "/usr/local/go" always ends up being the extraction timestamp) + tar \ + ; \ + arch="$(apk --print-arch)"; \ + url=; \ + case "$arch" in \ + 'x86_64') \ + url='https://dl.google.com/go/go1.25rc1.linux-amd64.tar.gz'; \ + sha256='7588a720e243e4672e0dc1c7942ec7592d480a80440fa2829be8b22c9c44a5b7'; \ + ;; \ + 'armhf') \ + url='https://dl.google.com/go/go1.25rc1.linux-armv6l.tar.gz'; \ + sha256='96a18398bc2bbbb2a144e0f30c431a1508351d43c1b1194c7647ca4a967dbc69'; \ + ;; \ + 'armv7') \ + url='https://dl.google.com/go/go1.25rc1.linux-armv6l.tar.gz'; \ + sha256='96a18398bc2bbbb2a144e0f30c431a1508351d43c1b1194c7647ca4a967dbc69'; \ + ;; \ + 'aarch64') \ + url='https://dl.google.com/go/go1.25rc1.linux-arm64.tar.gz'; \ + sha256='ee0b82bc1421c66f3f322a214218b423beddb64182e0105dbff142e777e96fc1'; \ + ;; \ + 'x86') \ + url='https://dl.google.com/go/go1.25rc1.linux-386.tar.gz'; \ + sha256='4fb3aee891b70edee4423fb457546a30341a7b112c38594af4ee5f6db77ac376'; \ + ;; \ + 'ppc64le') \ + url='https://dl.google.com/go/go1.25rc1.linux-ppc64le.tar.gz'; \ + sha256='1ffd0793a1288854e73096c673597854d30d065f18dc5803f39b8c729aa65f7b'; \ + ;; \ + 'riscv64') \ + url='https://dl.google.com/go/go1.25rc1.linux-riscv64.tar.gz'; \ + sha256='3e5fbc8fdc44a8bbd1b2393a6cc369eb6f43f99d424e0b01b1e38977989239fd'; \ + ;; \ + 's390x') \ + url='https://dl.google.com/go/go1.25rc1.linux-s390x.tar.gz'; \ + sha256='bfcea7cc93ab874185ef6c66a66dacc34ab01dbd03c4d0e5aad3d360c1a6c324'; \ + ;; \ + *) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \ + esac; \ + \ + wget -O go.tgz.asc "$url.asc"; \ + wget -O go.tgz "$url"; \ + echo "$sha256 *go.tgz" | sha256sum -c -; \ + \ +# https://github.com/golang/go/issues/14739#issuecomment-324767697 + GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ +# https://www.google.com/linuxrepositories/ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \ +# let's also fetch the specific subkey of that key explicitly that we expect "go.tgz.asc" to be signed by, just to make sure we definitely have it + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys '2F52 8D36 D67B 69ED F998 D857 78BD 6547 3CB3 BD13'; \ + gpg --batch --verify go.tgz.asc go.tgz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME" go.tgz.asc; \ + \ + tar -C /usr/local -xzf go.tgz; \ + rm go.tgz; \ + \ +# save the timestamp from the tarball so we can restore it for reproducibility, if necessary (see below) + SOURCE_DATE_EPOCH="$(stat -c '%Y' /usr/local/go)"; \ + export SOURCE_DATE_EPOCH; \ + touchy="$(date -d "@$SOURCE_DATE_EPOCH" '+%Y%m%d%H%M.%S')"; \ +# for logging validation/edification + date --date "@$SOURCE_DATE_EPOCH" --rfc-2822; \ +# sanity check (detected value should be older than our wall clock) + [ "$SOURCE_DATE_EPOCH" -lt "$now" ]; \ + \ + if [ "$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' ]; \ +# (re-)clamp timestamp for reproducibility (allows "COPY --link" to be more clever/useful) + touch -t "$touchy" /usr/local/go/go.env /usr/local/go; \ + fi; \ + \ +# ideally at this point, we would just "COPY --link ... /usr/local/go/ /usr/local/go/" but BuildKit insists on creating the parent directories (perhaps related to https://github.com/opencontainers/image-spec/pull/970), and does so with unreproducible timestamps, so we instead create a whole new "directory tree" that we can "COPY --link" to accomplish what we want + mkdir /target /target/usr /target/usr/local; \ + mv -vT /usr/local/go /target/usr/local/go; \ + ln -svfT /target/usr/local/go /usr/local/go; \ + touch -t "$touchy" /target/usr/local /target/usr /target; \ + \ + apk del --no-network .fetch-deps; \ + \ +# smoke test + go version; \ +# make sure our reproducibile timestamp is probably still correct (best-effort inline reproducibility test) + epoch="$(stat -c '%Y' /target/usr/local/go)"; \ + [ "$SOURCE_DATE_EPOCH" = "$epoch" ]; \ + find /target -newer /target/usr/local/go -exec sh -c 'ls -ld "$@" && exit "$#"' -- '{}' + + +FROM alpine:3.22 + +RUN apk add --no-cache ca-certificates + +ENV GOLANG_VERSION 1.25rc1 + +# don't auto-upgrade the gotoolchain +# https://github.com/docker-library/golang/issues/472 +ENV GOTOOLCHAIN=local + +ENV GOPATH /go +ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH +# (see notes above about "COPY --link") +COPY --from=build --link /target/ / +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH" +WORKDIR $GOPATH diff --git a/1.25-rc/bookworm/Dockerfile b/1.25-rc/bookworm/Dockerfile new file mode 100644 index 00000000..7fa57ecd --- /dev/null +++ b/1.25-rc/bookworm/Dockerfile @@ -0,0 +1,130 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM buildpack-deps:bookworm-scm AS build + +ENV PATH /usr/local/go/bin:$PATH + +ENV GOLANG_VERSION 1.25rc1 + +RUN set -eux; \ + now="$(date '+%s')"; \ + arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ + url=; \ + case "$arch" in \ + 'amd64') \ + url='https://dl.google.com/go/go1.25rc1.linux-amd64.tar.gz'; \ + sha256='7588a720e243e4672e0dc1c7942ec7592d480a80440fa2829be8b22c9c44a5b7'; \ + ;; \ + 'armhf') \ + url='https://dl.google.com/go/go1.25rc1.linux-armv6l.tar.gz'; \ + sha256='96a18398bc2bbbb2a144e0f30c431a1508351d43c1b1194c7647ca4a967dbc69'; \ + ;; \ + 'arm64') \ + url='https://dl.google.com/go/go1.25rc1.linux-arm64.tar.gz'; \ + sha256='ee0b82bc1421c66f3f322a214218b423beddb64182e0105dbff142e777e96fc1'; \ + ;; \ + 'i386') \ + url='https://dl.google.com/go/go1.25rc1.linux-386.tar.gz'; \ + sha256='4fb3aee891b70edee4423fb457546a30341a7b112c38594af4ee5f6db77ac376'; \ + ;; \ + 'mips64el') \ + url='https://dl.google.com/go/go1.25rc1.linux-mips64le.tar.gz'; \ + sha256='0808bdcdb389e2f695dd147089d889f93749adfa17c0c11a8dee9f32abd3c616'; \ + ;; \ + 'ppc64el') \ + url='https://dl.google.com/go/go1.25rc1.linux-ppc64le.tar.gz'; \ + sha256='1ffd0793a1288854e73096c673597854d30d065f18dc5803f39b8c729aa65f7b'; \ + ;; \ + 'riscv64') \ + url='https://dl.google.com/go/go1.25rc1.linux-riscv64.tar.gz'; \ + sha256='3e5fbc8fdc44a8bbd1b2393a6cc369eb6f43f99d424e0b01b1e38977989239fd'; \ + ;; \ + 's390x') \ + url='https://dl.google.com/go/go1.25rc1.linux-s390x.tar.gz'; \ + sha256='bfcea7cc93ab874185ef6c66a66dacc34ab01dbd03c4d0e5aad3d360c1a6c324'; \ + ;; \ + *) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \ + esac; \ + \ + wget -O go.tgz.asc "$url.asc"; \ + wget -O go.tgz "$url" --progress=dot:giga; \ + echo "$sha256 *go.tgz" | sha256sum -c -; \ + \ +# https://github.com/golang/go/issues/14739#issuecomment-324767697 + GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ +# https://www.google.com/linuxrepositories/ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \ +# let's also fetch the specific subkey of that key explicitly that we expect "go.tgz.asc" to be signed by, just to make sure we definitely have it + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys '2F52 8D36 D67B 69ED F998 D857 78BD 6547 3CB3 BD13'; \ + gpg --batch --verify go.tgz.asc go.tgz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME" go.tgz.asc; \ + \ + tar -C /usr/local -xzf go.tgz; \ + rm go.tgz; \ + \ +# save the timestamp from the tarball so we can restore it for reproducibility, if necessary (see below) + SOURCE_DATE_EPOCH="$(stat -c '%Y' /usr/local/go)"; \ + export SOURCE_DATE_EPOCH; \ + touchy="$(date -d "@$SOURCE_DATE_EPOCH" '+%Y%m%d%H%M.%S')"; \ +# for logging validation/edification + date --date "@$SOURCE_DATE_EPOCH" --rfc-2822; \ +# sanity check (detected value should be older than our wall clock) + [ "$SOURCE_DATE_EPOCH" -lt "$now" ]; \ + \ + if [ "$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' ]; \ +# (re-)clamp timestamp for reproducibility (allows "COPY --link" to be more clever/useful) + touch -t "$touchy" /usr/local/go/go.env /usr/local/go; \ + fi; \ + \ +# ideally at this point, we would just "COPY --link ... /usr/local/go/ /usr/local/go/" but BuildKit insists on creating the parent directories (perhaps related to https://github.com/opencontainers/image-spec/pull/970), and does so with unreproducible timestamps, so we instead create a whole new "directory tree" that we can "COPY --link" to accomplish what we want + mkdir /target /target/usr /target/usr/local; \ + mv -vT /usr/local/go /target/usr/local/go; \ + ln -svfT /target/usr/local/go /usr/local/go; \ + touch -t "$touchy" /target/usr/local /target/usr /target; \ + \ +# smoke test + go version; \ +# make sure our reproducibile timestamp is probably still correct (best-effort inline reproducibility test) + epoch="$(stat -c '%Y' /target/usr/local/go)"; \ + [ "$SOURCE_DATE_EPOCH" = "$epoch" ]; \ + find /target -newer /target/usr/local/go -exec sh -c 'ls -ld "$@" && exit "$#"' -- '{}' + + +FROM buildpack-deps:bookworm-scm + +# install cgo-related dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + g++ \ + gcc \ + libc6-dev \ + make \ + pkg-config \ + ; \ + rm -rf /var/lib/apt/lists/* + +ENV GOLANG_VERSION 1.25rc1 + +# don't auto-upgrade the gotoolchain +# https://github.com/docker-library/golang/issues/472 +ENV GOTOOLCHAIN=local + +ENV GOPATH /go +ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH +# (see notes above about "COPY --link") +COPY --from=build --link /target/ / +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH" +WORKDIR $GOPATH diff --git a/1.25-rc/bullseye/Dockerfile b/1.25-rc/bullseye/Dockerfile new file mode 100644 index 00000000..d2689aac --- /dev/null +++ b/1.25-rc/bullseye/Dockerfile @@ -0,0 +1,130 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM buildpack-deps:bullseye-scm AS build + +ENV PATH /usr/local/go/bin:$PATH + +ENV GOLANG_VERSION 1.25rc1 + +RUN set -eux; \ + now="$(date '+%s')"; \ + arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ + url=; \ + case "$arch" in \ + 'amd64') \ + url='https://dl.google.com/go/go1.25rc1.linux-amd64.tar.gz'; \ + sha256='7588a720e243e4672e0dc1c7942ec7592d480a80440fa2829be8b22c9c44a5b7'; \ + ;; \ + 'armhf') \ + url='https://dl.google.com/go/go1.25rc1.linux-armv6l.tar.gz'; \ + sha256='96a18398bc2bbbb2a144e0f30c431a1508351d43c1b1194c7647ca4a967dbc69'; \ + ;; \ + 'arm64') \ + url='https://dl.google.com/go/go1.25rc1.linux-arm64.tar.gz'; \ + sha256='ee0b82bc1421c66f3f322a214218b423beddb64182e0105dbff142e777e96fc1'; \ + ;; \ + 'i386') \ + url='https://dl.google.com/go/go1.25rc1.linux-386.tar.gz'; \ + sha256='4fb3aee891b70edee4423fb457546a30341a7b112c38594af4ee5f6db77ac376'; \ + ;; \ + 'mips64el') \ + url='https://dl.google.com/go/go1.25rc1.linux-mips64le.tar.gz'; \ + sha256='0808bdcdb389e2f695dd147089d889f93749adfa17c0c11a8dee9f32abd3c616'; \ + ;; \ + 'ppc64el') \ + url='https://dl.google.com/go/go1.25rc1.linux-ppc64le.tar.gz'; \ + sha256='1ffd0793a1288854e73096c673597854d30d065f18dc5803f39b8c729aa65f7b'; \ + ;; \ + 'riscv64') \ + url='https://dl.google.com/go/go1.25rc1.linux-riscv64.tar.gz'; \ + sha256='3e5fbc8fdc44a8bbd1b2393a6cc369eb6f43f99d424e0b01b1e38977989239fd'; \ + ;; \ + 's390x') \ + url='https://dl.google.com/go/go1.25rc1.linux-s390x.tar.gz'; \ + sha256='bfcea7cc93ab874185ef6c66a66dacc34ab01dbd03c4d0e5aad3d360c1a6c324'; \ + ;; \ + *) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \ + esac; \ + \ + wget -O go.tgz.asc "$url.asc"; \ + wget -O go.tgz "$url" --progress=dot:giga; \ + echo "$sha256 *go.tgz" | sha256sum -c -; \ + \ +# https://github.com/golang/go/issues/14739#issuecomment-324767697 + GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ +# https://www.google.com/linuxrepositories/ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \ +# let's also fetch the specific subkey of that key explicitly that we expect "go.tgz.asc" to be signed by, just to make sure we definitely have it + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys '2F52 8D36 D67B 69ED F998 D857 78BD 6547 3CB3 BD13'; \ + gpg --batch --verify go.tgz.asc go.tgz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME" go.tgz.asc; \ + \ + tar -C /usr/local -xzf go.tgz; \ + rm go.tgz; \ + \ +# save the timestamp from the tarball so we can restore it for reproducibility, if necessary (see below) + SOURCE_DATE_EPOCH="$(stat -c '%Y' /usr/local/go)"; \ + export SOURCE_DATE_EPOCH; \ + touchy="$(date -d "@$SOURCE_DATE_EPOCH" '+%Y%m%d%H%M.%S')"; \ +# for logging validation/edification + date --date "@$SOURCE_DATE_EPOCH" --rfc-2822; \ +# sanity check (detected value should be older than our wall clock) + [ "$SOURCE_DATE_EPOCH" -lt "$now" ]; \ + \ + if [ "$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' ]; \ +# (re-)clamp timestamp for reproducibility (allows "COPY --link" to be more clever/useful) + touch -t "$touchy" /usr/local/go/go.env /usr/local/go; \ + fi; \ + \ +# ideally at this point, we would just "COPY --link ... /usr/local/go/ /usr/local/go/" but BuildKit insists on creating the parent directories (perhaps related to https://github.com/opencontainers/image-spec/pull/970), and does so with unreproducible timestamps, so we instead create a whole new "directory tree" that we can "COPY --link" to accomplish what we want + mkdir /target /target/usr /target/usr/local; \ + mv -vT /usr/local/go /target/usr/local/go; \ + ln -svfT /target/usr/local/go /usr/local/go; \ + touch -t "$touchy" /target/usr/local /target/usr /target; \ + \ +# smoke test + go version; \ +# make sure our reproducibile timestamp is probably still correct (best-effort inline reproducibility test) + epoch="$(stat -c '%Y' /target/usr/local/go)"; \ + [ "$SOURCE_DATE_EPOCH" = "$epoch" ]; \ + find /target -newer /target/usr/local/go -exec sh -c 'ls -ld "$@" && exit "$#"' -- '{}' + + +FROM buildpack-deps:bullseye-scm + +# install cgo-related dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + g++ \ + gcc \ + libc6-dev \ + make \ + pkg-config \ + ; \ + rm -rf /var/lib/apt/lists/* + +ENV GOLANG_VERSION 1.25rc1 + +# don't auto-upgrade the gotoolchain +# https://github.com/docker-library/golang/issues/472 +ENV GOTOOLCHAIN=local + +ENV GOPATH /go +ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH +# (see notes above about "COPY --link") +COPY --from=build --link /target/ / +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH" +WORKDIR $GOPATH diff --git a/1.25-rc/windows/windowsservercore-ltsc2022/Dockerfile b/1.25-rc/windows/windowsservercore-ltsc2022/Dockerfile new file mode 100644 index 00000000..dc9cc21b --- /dev/null +++ b/1.25-rc/windows/windowsservercore-ltsc2022/Dockerfile @@ -0,0 +1,88 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM mcr.microsoft.com/windows/servercore:ltsc2022 + +# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +# install MinGit (especially for "go get") +# https://github.com/git-for-windows/git/wiki/MinGit +# https://gitforwindows.org/ +# https://github.com/git-for-windows/git/releases +# TODO in some future release, consider the BusyBox variant? maybe only once https://github.com/git-for-windows/git/issues/1439 is officially closed? +ENV GIT_VERSION 2.48.1 +ENV GIT_TAG v${GIT_VERSION}.windows.1 +ENV GIT_DOWNLOAD_URL https://github.com/git-for-windows/git/releases/download/${GIT_TAG}/MinGit-${GIT_VERSION}-64-bit.zip +ENV GIT_DOWNLOAD_SHA256 11e8f462726827acccc7ecdad541f2544cbe5506d70fef4fa1ffac7c16288709 +# steps inspired by "chcolateyInstall.ps1" from "git.install" (https://chocolatey.org/packages/git.install) +RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri $env:GIT_DOWNLOAD_URL -OutFile 'git.zip'; \ + \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:GIT_DOWNLOAD_SHA256); \ + if ((Get-FileHash git.zip -Algorithm sha256).Hash -ne $env:GIT_DOWNLOAD_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host 'Expanding ...'; \ + Expand-Archive -Path git.zip -DestinationPath C:\git\.; \ + \ + Write-Host 'Removing ...'; \ + Remove-Item git.zip -Force; \ + \ + Write-Host 'Updating PATH ...'; \ + $env:PATH = 'C:\git\cmd;C:\git\mingw64\bin;C:\git\usr\bin;' + $env:PATH; \ + [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \ + \ + Write-Host 'Verifying install ("git version") ...'; \ + git version; \ + \ + Write-Host 'Complete.'; +# https://blogs.msdn.microsoft.com/visualstudioalm/2016/09/03/whats-new-in-git-for-windows-2-10/ +# "Essentially, it is a Git for Windows that was stripped down as much as possible without sacrificing the functionality in which 3rd-party software may be interested." +# "It currently requires only ~45MB on disk." + +# for 1.17+, we'll follow the (new) Go upstream default for install (https://golang.org/cl/283600), which frees up C:\go to be the default GOPATH and thus match the Linux images more closely (https://github.com/docker-library/golang/issues/288) +ENV GOPATH C:\\go +# HOWEVER, please note that it is the Go upstream intention to remove GOPATH support entirely: https://blog.golang.org/go116-module-changes + +# PATH isn't actually set in the Docker image, so we have to set it from within the container +RUN $newPath = ('{0}\bin;C:\Program Files\Go\bin;{1}' -f $env:GOPATH, $env:PATH); \ + Write-Host ('Updating PATH: {0}' -f $newPath); \ + [Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Machine); +# doing this first to share cache across versions more aggressively + +ENV GOLANG_VERSION 1.25rc1 + +RUN $url = 'https://dl.google.com/go/go1.25rc1.windows-amd64.zip'; \ + Write-Host ('Downloading {0} ...' -f $url); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri $url -OutFile 'go.zip'; \ + \ + $sha256 = '0879e884a1300034f7ae48180b12a9fedec861c2c2f94b9af4b6604cf06cc9d7'; \ + Write-Host ('Verifying sha256 ({0}) ...' -f $sha256); \ + if ((Get-FileHash go.zip -Algorithm sha256).Hash -ne $sha256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host 'Expanding ...'; \ + Expand-Archive go.zip -DestinationPath C:\; \ + \ + Write-Host 'Moving ...'; \ + Move-Item -Path C:\go -Destination 'C:\Program Files\Go'; \ + \ + Write-Host 'Removing ...'; \ + Remove-Item go.zip -Force; \ + \ + Write-Host 'Verifying install ("go version") ...'; \ + go version; \ + \ + Write-Host 'Complete.'; + +WORKDIR $GOPATH diff --git a/1.25-rc/windows/windowsservercore-ltsc2025/Dockerfile b/1.25-rc/windows/windowsservercore-ltsc2025/Dockerfile new file mode 100644 index 00000000..0cd775d6 --- /dev/null +++ b/1.25-rc/windows/windowsservercore-ltsc2025/Dockerfile @@ -0,0 +1,88 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM mcr.microsoft.com/windows/servercore:ltsc2025 + +# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +# install MinGit (especially for "go get") +# https://github.com/git-for-windows/git/wiki/MinGit +# https://gitforwindows.org/ +# https://github.com/git-for-windows/git/releases +# TODO in some future release, consider the BusyBox variant? maybe only once https://github.com/git-for-windows/git/issues/1439 is officially closed? +ENV GIT_VERSION 2.48.1 +ENV GIT_TAG v${GIT_VERSION}.windows.1 +ENV GIT_DOWNLOAD_URL https://github.com/git-for-windows/git/releases/download/${GIT_TAG}/MinGit-${GIT_VERSION}-64-bit.zip +ENV GIT_DOWNLOAD_SHA256 11e8f462726827acccc7ecdad541f2544cbe5506d70fef4fa1ffac7c16288709 +# steps inspired by "chcolateyInstall.ps1" from "git.install" (https://chocolatey.org/packages/git.install) +RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri $env:GIT_DOWNLOAD_URL -OutFile 'git.zip'; \ + \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:GIT_DOWNLOAD_SHA256); \ + if ((Get-FileHash git.zip -Algorithm sha256).Hash -ne $env:GIT_DOWNLOAD_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host 'Expanding ...'; \ + Expand-Archive -Path git.zip -DestinationPath C:\git\.; \ + \ + Write-Host 'Removing ...'; \ + Remove-Item git.zip -Force; \ + \ + Write-Host 'Updating PATH ...'; \ + $env:PATH = 'C:\git\cmd;C:\git\mingw64\bin;C:\git\usr\bin;' + $env:PATH; \ + [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \ + \ + Write-Host 'Verifying install ("git version") ...'; \ + git version; \ + \ + Write-Host 'Complete.'; +# https://blogs.msdn.microsoft.com/visualstudioalm/2016/09/03/whats-new-in-git-for-windows-2-10/ +# "Essentially, it is a Git for Windows that was stripped down as much as possible without sacrificing the functionality in which 3rd-party software may be interested." +# "It currently requires only ~45MB on disk." + +# for 1.17+, we'll follow the (new) Go upstream default for install (https://golang.org/cl/283600), which frees up C:\go to be the default GOPATH and thus match the Linux images more closely (https://github.com/docker-library/golang/issues/288) +ENV GOPATH C:\\go +# HOWEVER, please note that it is the Go upstream intention to remove GOPATH support entirely: https://blog.golang.org/go116-module-changes + +# PATH isn't actually set in the Docker image, so we have to set it from within the container +RUN $newPath = ('{0}\bin;C:\Program Files\Go\bin;{1}' -f $env:GOPATH, $env:PATH); \ + Write-Host ('Updating PATH: {0}' -f $newPath); \ + [Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Machine); +# doing this first to share cache across versions more aggressively + +ENV GOLANG_VERSION 1.25rc1 + +RUN $url = 'https://dl.google.com/go/go1.25rc1.windows-amd64.zip'; \ + Write-Host ('Downloading {0} ...' -f $url); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri $url -OutFile 'go.zip'; \ + \ + $sha256 = '0879e884a1300034f7ae48180b12a9fedec861c2c2f94b9af4b6604cf06cc9d7'; \ + Write-Host ('Verifying sha256 ({0}) ...' -f $sha256); \ + if ((Get-FileHash go.zip -Algorithm sha256).Hash -ne $sha256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host 'Expanding ...'; \ + Expand-Archive go.zip -DestinationPath C:\; \ + \ + Write-Host 'Moving ...'; \ + Move-Item -Path C:\go -Destination 'C:\Program Files\Go'; \ + \ + Write-Host 'Removing ...'; \ + Remove-Item go.zip -Force; \ + \ + Write-Host 'Verifying install ("go version") ...'; \ + go version; \ + \ + Write-Host 'Complete.'; + +WORKDIR $GOPATH diff --git a/Dockerfile-linux.template b/Dockerfile-linux.template index 1f207db5..a2a8db8d 100644 --- a/Dockerfile-linux.template +++ b/Dockerfile-linux.template @@ -4,34 +4,24 @@ ; def alpine_version: env.variant | ltrimstr("alpine") - ; - def always_build_from_source: - # https://github.com/golang/go/issues/57007! (as of Go 1.21, the upstream release binaries are fully static and thus appropriate for Alpine) - is_alpine and ([ "1.20" ] | index(env.version | rtrimstr("-rc"))) -}} {{ if is_alpine then ( -}} -FROM alpine:{{ alpine_version }} - -RUN apk add --no-cache ca-certificates +FROM alpine:{{ alpine_version }} AS build {{ ) else ( -}} -FROM buildpack-deps:{{ env.variant }}-scm - -# install cgo-related dependencies -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - g++ \ - gcc \ - libc6-dev \ - make \ - pkg-config \ - ; \ - rm -rf /var/lib/apt/lists/* +FROM buildpack-deps:{{ env.variant }}-scm AS build {{ ) end -}} ENV PATH /usr/local/go/bin:$PATH +{{ if env.version != "tip" then ( -}} ENV GOLANG_VERSION {{ .version }} +{{ ) else ( -}} +COPY --from=golang:{{ env.variant }} /usr/local/go /usr/local/goroot-bootstrap + +# {{ .version }}: https://github.com/golang/go/tree/{{ .commit.version }} +ARG GOLANG_COMMIT={{ .commit.version | @sh }} +ENV GOLANG_COMMIT $GOLANG_COMMIT +{{ ) end -}} {{ def os_arches: @@ -52,6 +42,7 @@ ENV GOLANG_VERSION {{ .version }} { # https://salsa.debian.org/dpkg-team/dpkg/-/blob/main/data/cputable # https://wiki.debian.org/ArchitectureSpecificsMemo#Architecture_baselines + # https://deb.debian.org/debian/dists/unstable/Release ("Architectures:") # http://deb.debian.org/debian/dists/unstable/main/ # http://deb.debian.org/debian/dists/stable/main/ # https://deb.debian.org/debian-ports/dists/unstable/main/ @@ -68,13 +59,26 @@ ENV GOLANG_VERSION {{ .version }} end -}} RUN set -eux; \ + now="$(date '+%s')"; \ {{ if is_alpine then ( -}} - apk add --no-cache --virtual .fetch-deps gnupg; \ + apk add --no-cache --virtual .fetch-deps \ +{{ if env.version != "tip" then ( -}} + ca-certificates \ + gnupg \ +# busybox's "tar" doesn't handle directory mtime correctly, so our SOURCE_DATE_EPOCH lookup doesn't work (the mtime of "/usr/local/go" always ends up being the extraction timestamp) + tar \ +{{ ) else ( -}} + bash \ + git \ +{{ ) end -}} + ; \ arch="$(apk --print-arch)"; \ {{ ) else ( -}} arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ {{ ) end -}} +{{ if env.version != "tip" then ( -}} url=; \ +{{ ) else "" end -}} case "$arch" in \ {{ [ @@ -89,11 +93,11 @@ RUN set -eux; \ | ( -}} {{ $osArch | @sh }}) \ -{{ if always_build_from_source or (.url | not) then ( -}} - export {{ .env | to_entries | map(.key + "=" + (.value | @sh)) | join(" ") }}; \ -{{ ) else ( -}} +{{ if env.version != "tip" then ( -}} url={{ .url | @sh }}; \ sha256={{ .sha256 | @sh }}; \ +{{ ) else ( -}} + export {{ .env | to_entries | sort_by(.key) | map(.key + "=" + (.value | @sh)) | join(" ") }}; \ {{ ) end -}} ;; \ {{ @@ -102,21 +106,8 @@ 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={{ .arches.src.url | @sh }}; \ - sha256={{ .arches.src.sha256 | @sh }}; \ -{{ if always_build_from_source then ( -}} -# the precompiled binaries published by Go upstream are not compatible with Alpine, so we always build from source here πŸ˜… -{{ ) else ( -}} - echo >&2; \ - echo >&2 "warning: current architecture ($arch) does not have a compatible Go binary release; will be building from source"; \ - echo >&2; \ -{{ ) end -}} - fi; \ \ +{{ if env.version != "tip" then ( -}} wget -O go.tgz.asc "$url.asc"; \ wget -O go.tgz "$url"{{ if is_alpine then "" else " --progress=dot:giga" end }}; \ echo "$sha256 *go.tgz" | sha256sum -c -; \ @@ -134,57 +125,42 @@ RUN set -eux; \ tar -C /usr/local -xzf go.tgz; \ rm go.tgz; \ \ - if [ -n "$build" ]; then \ -{{ if is_alpine then ( -}} - apk add --no-cache --virtual .build-deps \ - bash \ - gcc \ - go \ - musl-dev \ - ; \ -{{ ) else ( -}} - savedAptMark="$(apt-mark showmanual)"; \ -{{ if env.variant != "bullseye" then ( -}} - apt-get update; \ - apt-get install -y --no-install-recommends golang-go; \ +# save the timestamp from the tarball so we can restore it for reproducibility, if necessary (see below) + SOURCE_DATE_EPOCH="$(stat -c '%Y' /usr/local/go)"; \ {{ ) else ( -}} -# 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; \ - ); \ -{{ ) end -}} +# before we get too far, let's validate that our "bootstrap" Go works + export GOROOT_BOOTSTRAP=/usr/local/goroot-bootstrap; \ + "$GOROOT_BOOTSTRAP/bin/go" version; \ + \ + git init --quiet /usr/local/go; \ + git -C /usr/local/go fetch --depth 1 https://github.com/golang/go.git "$GOLANG_COMMIT:"; \ + git -C /usr/local/go checkout --quiet FETCH_HEAD; \ + \ +# save the Git timestamp so we can use it for reproducibility + SOURCE_DATE_EPOCH="$(git -C /usr/local/go log -1 --format='format:%ct' HEAD)"; \ {{ ) end -}} + export SOURCE_DATE_EPOCH; \ + touchy="$(date -d "@$SOURCE_DATE_EPOCH" '+%Y%m%d%H%M.%S')"; \ +# for logging validation/edification + date --date "@$SOURCE_DATE_EPOCH" --rfc-2822; \ +# sanity check (detected value should be older than our wall clock) + [ "$SOURCE_DATE_EPOCH" -lt "$now" ]; \ + \ +{{ if env.version == "tip" then ( -}} + ( \ + export \ + GOCACHE='/tmp/gocache' \ +# set GOHOST* to make sure explicitly 32bit builds on 64bit infra work correctly + GOHOSTOS="$GOOS" \ + GOHOSTARCH="$GOARCH" \ + ; \ \ - 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 is_alpine then ( -}} - 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; \ -{{ ) else "" end -}} - ./make.bash; \ - ); \ + cd /usr/local/go/src; \ + ./make.bash; \ \ -{{ if is_alpine then ( -}} - apk del --no-network .build-deps; \ -{{ ) else ( -}} - 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/*; \ -{{ ) end -}} - \ -# remove a few intermediate / bootstrapping files the official binary release tarballs do not contain +# remove a few intermediate / bootstrapping files the official binary release tarballs do not contain (and ".git" that is hard to make reproducible) rm -rf \ + /usr/local/go/.git* \ /usr/local/go/pkg/*/cmd \ /usr/local/go/pkg/bootstrap \ /usr/local/go/pkg/obj \ @@ -193,21 +169,76 @@ RUN set -eux; \ /usr/local/go/src/cmd/dist/dist \ "$GOCACHE" \ ; \ + \ +# clamp timestamps for reproducibility (allows "COPY --link" to be more clever/useful) + touch -t "$touchy" /usr/local/.go-date-stamp; \ + find /usr/local/go -depth -newer /usr/local/.go-date-stamp -exec touch -ht "$touchy" '{}' +; \ + rm /usr/local/.go-date-stamp; \ + ); \ + \ +{{ ) elif .arches["arm32v7"].url // "" | contains("armv6") then ( -}} + if [ "$arch" = {{ os_arches["arm32v7"] | @sh }} ]; then \ + [ -s /usr/local/go/go.env ]; \ + before="$(go env GOARM)"; [ "$before" != {{ .arches["arm32v7"].env["GOARM"] | @sh }} ]; \ + { \ + echo; \ + echo '# https://github.com/docker-library/golang/issues/494'; \ + echo {{ "GOARM=\(.arches["arm32v7"].env["GOARM"])" | @sh }}; \ + } >> /usr/local/go/go.env; \ + after="$(go env GOARM)"; [ "$after" = {{ .arches["arm32v7"].env["GOARM"] | @sh }} ]; \ +# (re-)clamp timestamp for reproducibility (allows "COPY --link" to be more clever/useful) + touch -t "$touchy" /usr/local/go/go.env /usr/local/go; \ fi; \ \ +{{ ) else "" end -}} +# ideally at this point, we would just "COPY --link ... /usr/local/go/ /usr/local/go/" but BuildKit insists on creating the parent directories (perhaps related to https://github.com/opencontainers/image-spec/pull/970), and does so with unreproducible timestamps, so we instead create a whole new "directory tree" that we can "COPY --link" to accomplish what we want + mkdir /target /target/usr /target/usr/local; \ + mv -vT /usr/local/go /target/usr/local/go; \ + ln -svfT /target/usr/local/go /usr/local/go; \ + touch -t "$touchy" /target/usr/local /target/usr /target; \ + \ {{ if is_alpine then ( -}} apk del --no-network .fetch-deps; \ \ {{ ) else "" end -}} - go version +# smoke test + go version; \ +# make sure our reproducibile timestamp is probably still correct (best-effort inline reproducibility test) + epoch="$(stat -c '%Y' /target/usr/local/go)"; \ + [ "$SOURCE_DATE_EPOCH" = "$epoch" ]; \ + find /target -newer /target/usr/local/go -exec sh -c 'ls -ld "$@" && exit "$#"' -- '{}' + + +{{ if is_alpine then ( -}} +FROM alpine:{{ alpine_version }} + +RUN apk add --no-cache ca-certificates +{{ ) else ( -}} +FROM buildpack-deps:{{ env.variant }}-scm + +# install cgo-related dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + g++ \ + gcc \ + libc6-dev \ + make \ + pkg-config \ + ; \ + rm -rf /var/lib/apt/lists/* +{{ ) end -}} -{{ if [ "1.20" ] | index(env.version | rtrimstr("-rc")) then "" else ( -}} +{{ if env.version != "tip" then ( -}} +ENV GOLANG_VERSION {{ .version }} + +{{ ) else "" end -}} # don't auto-upgrade the gotoolchain # https://github.com/docker-library/golang/issues/472 ENV GOTOOLCHAIN=local -{{ ) end -}} ENV GOPATH /go -ENV PATH $GOPATH/bin:$PATH +ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH +# (see notes above about "COPY --link") +COPY --from=build --link /target/ / RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH" WORKDIR $GOPATH diff --git a/Dockerfile-windows-servercore.template b/Dockerfile-windows-servercore.template index 97f6f3fe..dda8f8f9 100644 --- a/Dockerfile-windows-servercore.template +++ b/Dockerfile-windows-servercore.template @@ -4,13 +4,14 @@ FROM mcr.microsoft.com/windows/{{ env.windowsVariant }}:{{ env.windowsRelease }} SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] # install MinGit (especially for "go get") -# https://blogs.msdn.microsoft.com/visualstudioalm/2016/09/03/whats-new-in-git-for-windows-2-10/ -# "Essentially, it is a Git for Windows that was stripped down as much as possible without sacrificing the functionality in which 3rd-party software may be interested." -# "It currently requires only ~45MB on disk." -ENV GIT_VERSION 2.23.0 +# https://github.com/git-for-windows/git/wiki/MinGit +# https://gitforwindows.org/ +# https://github.com/git-for-windows/git/releases +# TODO in some future release, consider the BusyBox variant? maybe only once https://github.com/git-for-windows/git/issues/1439 is officially closed? +ENV GIT_VERSION 2.48.1 ENV GIT_TAG v${GIT_VERSION}.windows.1 ENV GIT_DOWNLOAD_URL https://github.com/git-for-windows/git/releases/download/${GIT_TAG}/MinGit-${GIT_VERSION}-64-bit.zip -ENV GIT_DOWNLOAD_SHA256 8f65208f92c0b4c3ae4c0cf02d4b5f6791d539cd1a07b2df62b7116467724735 +ENV GIT_DOWNLOAD_SHA256 11e8f462726827acccc7ecdad541f2544cbe5506d70fef4fa1ffac7c16288709 # steps inspired by "chcolateyInstall.ps1" from "git.install" (https://chocolatey.org/packages/git.install) RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ @@ -36,6 +37,9 @@ RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \ git version; \ \ Write-Host 'Complete.'; +# https://blogs.msdn.microsoft.com/visualstudioalm/2016/09/03/whats-new-in-git-for-windows-2-10/ +# "Essentially, it is a Git for Windows that was stripped down as much as possible without sacrificing the functionality in which 3rd-party software may be interested." +# "It currently requires only ~45MB on disk." # for 1.17+, we'll follow the (new) Go upstream default for install (https://golang.org/cl/283600), which frees up C:\go to be the default GOPATH and thus match the Linux images more closely (https://github.com/docker-library/golang/issues/288) ENV GOPATH C:\\go diff --git a/README.md b/README.md index 222ac849..be432dbe 100644 --- a/README.md +++ b/README.md @@ -12,15 +12,4 @@ For more information about the full official images change lifecycle, see [the " For outstanding `golang` image PRs, check [PRs with the "library/golang" label on the official-images repository](https://github.com/docker-library/official-images/labels/library%2Fgolang). For the current "source of truth" for [`golang`](https://hub.docker.com/_/golang/), see [the `library/golang` file in the official-images repository](https://github.com/docker-library/official-images/blob/master/library/golang). ---- - -- [![build status badge](https://img.shields.io/github/actions/workflow/status/docker-library/golang/ci.yml?branch=master&label=GitHub%20CI)](https://github.com/docker-library/golang/actions?query=workflow%3A%22GitHub+CI%22+branch%3Amaster) -- [![build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/update.sh/job/golang.svg?label=Automated%20update.sh)](https://doi-janky.infosiftr.net/job/update.sh/job/golang/) - -| Build | Status | Badges | (per-arch) | -|:-:|:-:|:-:|:-:| -| [![amd64 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/amd64/job/golang.svg?label=amd64)](https://doi-janky.infosiftr.net/job/multiarch/job/amd64/job/golang/) | [![arm32v5 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v5/job/golang.svg?label=arm32v5)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v5/job/golang/) | [![arm32v6 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v6/job/golang.svg?label=arm32v6)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v6/job/golang/) | [![arm32v7 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v7/job/golang.svg?label=arm32v7)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v7/job/golang/) | -| [![arm64v8 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm64v8/job/golang.svg?label=arm64v8)](https://doi-janky.infosiftr.net/job/multiarch/job/arm64v8/job/golang/) | [![i386 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/i386/job/golang.svg?label=i386)](https://doi-janky.infosiftr.net/job/multiarch/job/i386/job/golang/) | [![mips64le build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/mips64le/job/golang.svg?label=mips64le)](https://doi-janky.infosiftr.net/job/multiarch/job/mips64le/job/golang/) | [![ppc64le build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/ppc64le/job/golang.svg?label=ppc64le)](https://doi-janky.infosiftr.net/job/multiarch/job/ppc64le/job/golang/) | -| [![s390x build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/s390x/job/golang.svg?label=s390x)](https://doi-janky.infosiftr.net/job/multiarch/job/s390x/job/golang/) | [![windows-amd64 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/windows-amd64/job/golang.svg?label=windows-amd64)](https://doi-janky.infosiftr.net/job/multiarch/job/windows-amd64/job/golang/) | [![put-shared build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/put-shared/job/light/job/golang.svg?label=put-shared)](https://doi-janky.infosiftr.net/job/put-shared/job/light/job/golang/) | - diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index eadf2b69..979e9800 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -2,19 +2,24 @@ set -Eeuo pipefail declare -A aliases=( - [1.21]='1 latest' + #[1.24]='1 latest' ) +# because we sort in versions.sh, we can assume the first non-rc in versions.json is the "latest" release +latest="$(jq -r 'first(keys_unsorted - ["tip"] | .[] | select(endswith("-rc") | not))' versions.json)" +[ -n "$latest" ] +aliases["$latest"]+=' 1 latest' +export latest + self="$(basename "$BASH_SOURCE")" cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" if [ "$#" -eq 0 ]; then - versions="$(jq -r 'keys | map(@sh) | join(" ")' versions.json)" + versions="$(jq -r 'keys_unsorted | map(@sh) | join(" ")' versions.json)" eval "set -- $versions" fi -# sort version numbers with highest first -IFS=$'\n'; set -- $(sort -rV <<<"$*"); unset IFS +# no sort because we already sorted the keys in versions.sh (hence "keys_unsorted" above) # get the most recent commit which modified any of "$@" fileCommit() { @@ -44,17 +49,19 @@ dirCommit() { getArches() { local repo="$1"; shift - local officialImagesUrl='https://github.com/docker-library/official-images/raw/master/library/' + local officialImagesBase="${BASHBREW_LIBRARY:-https://github.com/docker-library/official-images/raw/HEAD/library}/" - eval "declare -g -A parentRepoToArches=( $( - find -name 'Dockerfile' -exec awk ' + local parentRepoToArchesStr + parentRepoToArchesStr="$( + find -name 'Dockerfile' -exec awk -v officialImagesBase="$officialImagesBase" ' toupper($1) == "FROM" && $2 !~ /^('"$repo"'|scratch|.*\/.*)(:|$)/ { - print "'"$officialImagesUrl"'" $2 + printf "%s%s\n", officialImagesBase, $2 } ' '{}' + \ | sort -u \ - | xargs bashbrew cat --format '[{{ .RepoName }}:{{ .TagName }}]="{{ join " " .TagEntry.Architectures }}"' - ) )" + | xargs -r bashbrew cat --format '["{{ .RepoName }}:{{ .TagName }}"]="{{ join " " .TagEntry.Architectures }}"' + )" + eval "declare -g -A parentRepoToArches=( $parentRepoToArchesStr )" } getArches 'golang' @@ -65,6 +72,7 @@ Maintainers: Tianon Gravi (@tianon), Joseph Ferguson (@yosifkit), Johan Euphrosine (@proppy) GitRepo: https://github.com/docker-library/golang.git +Builder: buildkit EOH # prints "$2$1$3$1...$N" @@ -110,8 +118,6 @@ for version; do fullVersion="$(jq -r '.[env.version].version' versions.json)" - [[ "$fullVersion" == *.*[^0-9]* ]] || fullVersion+='.0' - if [ "$version" = "$fullVersion" ]; then baseAliases=( "${versionAliases[@]}" ) else @@ -131,14 +137,20 @@ for version; do ;; *) - variantParent="$(awk 'toupper($1) == "FROM" { print $2 }' "$dir/Dockerfile")" + variantParent="$(awk 'toupper($1) == "FROM" { print $2 }' "$dir/Dockerfile" | sort -u)" # TODO this needs to handle multi-parents (we get lucky that they're the same) variantArches="${parentRepoToArches[$variantParent]}" ;; esac # cross-reference with supported architectures for arch in $variantArches; do - if ! jq -e --arg arch "$arch" '.[env.version].arches[$arch].supported' versions.json &> /dev/null; then + if ! jq -e --arg arch "$arch" ' + .[env.version].arches[$arch].supported + # if the version we are checking is "tip", we need to cross-reference "latest" also (since it uses latest as GOROOT_BOOTSTRAP via COPY --from) + and if env.version == "tip" then + .[env.latest].arches[$arch].supported + else true end + ' versions.json &> /dev/null; then variantArches="$(sed <<<" $variantArches " -e "s/ $arch / /g")" fi done @@ -183,6 +195,9 @@ for version; do GitCommit: $commit Directory: $dir EOE - [ -z "$constraints" ] || echo "Constraints: $constraints" + if [ -n "$constraints" ]; then + echo 'Builder: classic' + echo "Constraints: $constraints" + fi done done diff --git a/tip/alpine3.21/Dockerfile b/tip/alpine3.21/Dockerfile new file mode 100644 index 00000000..0cec4d4a --- /dev/null +++ b/tip/alpine3.21/Dockerfile @@ -0,0 +1,126 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.21 AS build + +ENV PATH /usr/local/go/bin:$PATH + +COPY --from=golang:alpine3.21 /usr/local/go /usr/local/goroot-bootstrap + +# tip-20250613: https://github.com/golang/go/tree/96a6e147b2b02b1f070d559cb2c8e1c25c9b78c3 +ARG GOLANG_COMMIT='96a6e147b2b02b1f070d559cb2c8e1c25c9b78c3' +ENV GOLANG_COMMIT $GOLANG_COMMIT + +RUN set -eux; \ + now="$(date '+%s')"; \ + apk add --no-cache --virtual .fetch-deps \ + bash \ + git \ + ; \ + arch="$(apk --print-arch)"; \ + case "$arch" in \ + 'x86_64') \ + export GOAMD64='v1' GOARCH='amd64' GOOS='linux'; \ + ;; \ + 'armhf') \ + export GOARCH='arm' GOARM='6' GOOS='linux'; \ + ;; \ + 'armv7') \ + export GOARCH='arm' GOARM='7' GOOS='linux'; \ + ;; \ + 'aarch64') \ + export GOARCH='arm64' GOARM64='v8.0' GOOS='linux'; \ + ;; \ + 'x86') \ + export GO386='softfloat' GOARCH='386' GOOS='linux'; \ + ;; \ + 'ppc64le') \ + export GOARCH='ppc64le' GOOS='linux'; \ + ;; \ + 'riscv64') \ + export GOARCH='riscv64' GOOS='linux' GORISCV64='rva20u64'; \ + ;; \ + 's390x') \ + export GOARCH='s390x' GOOS='linux'; \ + ;; \ + *) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \ + esac; \ + \ +# before we get too far, let's validate that our "bootstrap" Go works + export GOROOT_BOOTSTRAP=/usr/local/goroot-bootstrap; \ + "$GOROOT_BOOTSTRAP/bin/go" version; \ + \ + git init --quiet /usr/local/go; \ + git -C /usr/local/go fetch --depth 1 https://github.com/golang/go.git "$GOLANG_COMMIT:"; \ + git -C /usr/local/go checkout --quiet FETCH_HEAD; \ + \ +# save the Git timestamp so we can use it for reproducibility + SOURCE_DATE_EPOCH="$(git -C /usr/local/go log -1 --format='format:%ct' HEAD)"; \ + export SOURCE_DATE_EPOCH; \ + touchy="$(date -d "@$SOURCE_DATE_EPOCH" '+%Y%m%d%H%M.%S')"; \ +# for logging validation/edification + date --date "@$SOURCE_DATE_EPOCH" --rfc-2822; \ +# sanity check (detected value should be older than our wall clock) + [ "$SOURCE_DATE_EPOCH" -lt "$now" ]; \ + \ + ( \ + export \ + GOCACHE='/tmp/gocache' \ +# set GOHOST* to make sure explicitly 32bit builds on 64bit infra work correctly + GOHOSTOS="$GOOS" \ + GOHOSTARCH="$GOARCH" \ + ; \ + \ + cd /usr/local/go/src; \ + ./make.bash; \ + \ +# remove a few intermediate / bootstrapping files the official binary release tarballs do not contain (and ".git" that is hard to make reproducible) + rm -rf \ + /usr/local/go/.git* \ + /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" \ + ; \ + \ +# clamp timestamps for reproducibility (allows "COPY --link" to be more clever/useful) + touch -t "$touchy" /usr/local/.go-date-stamp; \ + find /usr/local/go -depth -newer /usr/local/.go-date-stamp -exec touch -ht "$touchy" '{}' +; \ + rm /usr/local/.go-date-stamp; \ + ); \ + \ +# ideally at this point, we would just "COPY --link ... /usr/local/go/ /usr/local/go/" but BuildKit insists on creating the parent directories (perhaps related to https://github.com/opencontainers/image-spec/pull/970), and does so with unreproducible timestamps, so we instead create a whole new "directory tree" that we can "COPY --link" to accomplish what we want + mkdir /target /target/usr /target/usr/local; \ + mv -vT /usr/local/go /target/usr/local/go; \ + ln -svfT /target/usr/local/go /usr/local/go; \ + touch -t "$touchy" /target/usr/local /target/usr /target; \ + \ + apk del --no-network .fetch-deps; \ + \ +# smoke test + go version; \ +# make sure our reproducibile timestamp is probably still correct (best-effort inline reproducibility test) + epoch="$(stat -c '%Y' /target/usr/local/go)"; \ + [ "$SOURCE_DATE_EPOCH" = "$epoch" ]; \ + find /target -newer /target/usr/local/go -exec sh -c 'ls -ld "$@" && exit "$#"' -- '{}' + + +FROM alpine:3.21 + +RUN apk add --no-cache ca-certificates + +# don't auto-upgrade the gotoolchain +# https://github.com/docker-library/golang/issues/472 +ENV GOTOOLCHAIN=local + +ENV GOPATH /go +ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH +# (see notes above about "COPY --link") +COPY --from=build --link /target/ / +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH" +WORKDIR $GOPATH diff --git a/tip/alpine3.22/Dockerfile b/tip/alpine3.22/Dockerfile new file mode 100644 index 00000000..587ec24c --- /dev/null +++ b/tip/alpine3.22/Dockerfile @@ -0,0 +1,126 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.22 AS build + +ENV PATH /usr/local/go/bin:$PATH + +COPY --from=golang:alpine3.22 /usr/local/go /usr/local/goroot-bootstrap + +# tip-20250613: https://github.com/golang/go/tree/96a6e147b2b02b1f070d559cb2c8e1c25c9b78c3 +ARG GOLANG_COMMIT='96a6e147b2b02b1f070d559cb2c8e1c25c9b78c3' +ENV GOLANG_COMMIT $GOLANG_COMMIT + +RUN set -eux; \ + now="$(date '+%s')"; \ + apk add --no-cache --virtual .fetch-deps \ + bash \ + git \ + ; \ + arch="$(apk --print-arch)"; \ + case "$arch" in \ + 'x86_64') \ + export GOAMD64='v1' GOARCH='amd64' GOOS='linux'; \ + ;; \ + 'armhf') \ + export GOARCH='arm' GOARM='6' GOOS='linux'; \ + ;; \ + 'armv7') \ + export GOARCH='arm' GOARM='7' GOOS='linux'; \ + ;; \ + 'aarch64') \ + export GOARCH='arm64' GOARM64='v8.0' GOOS='linux'; \ + ;; \ + 'x86') \ + export GO386='softfloat' GOARCH='386' GOOS='linux'; \ + ;; \ + 'ppc64le') \ + export GOARCH='ppc64le' GOOS='linux'; \ + ;; \ + 'riscv64') \ + export GOARCH='riscv64' GOOS='linux' GORISCV64='rva20u64'; \ + ;; \ + 's390x') \ + export GOARCH='s390x' GOOS='linux'; \ + ;; \ + *) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \ + esac; \ + \ +# before we get too far, let's validate that our "bootstrap" Go works + export GOROOT_BOOTSTRAP=/usr/local/goroot-bootstrap; \ + "$GOROOT_BOOTSTRAP/bin/go" version; \ + \ + git init --quiet /usr/local/go; \ + git -C /usr/local/go fetch --depth 1 https://github.com/golang/go.git "$GOLANG_COMMIT:"; \ + git -C /usr/local/go checkout --quiet FETCH_HEAD; \ + \ +# save the Git timestamp so we can use it for reproducibility + SOURCE_DATE_EPOCH="$(git -C /usr/local/go log -1 --format='format:%ct' HEAD)"; \ + export SOURCE_DATE_EPOCH; \ + touchy="$(date -d "@$SOURCE_DATE_EPOCH" '+%Y%m%d%H%M.%S')"; \ +# for logging validation/edification + date --date "@$SOURCE_DATE_EPOCH" --rfc-2822; \ +# sanity check (detected value should be older than our wall clock) + [ "$SOURCE_DATE_EPOCH" -lt "$now" ]; \ + \ + ( \ + export \ + GOCACHE='/tmp/gocache' \ +# set GOHOST* to make sure explicitly 32bit builds on 64bit infra work correctly + GOHOSTOS="$GOOS" \ + GOHOSTARCH="$GOARCH" \ + ; \ + \ + cd /usr/local/go/src; \ + ./make.bash; \ + \ +# remove a few intermediate / bootstrapping files the official binary release tarballs do not contain (and ".git" that is hard to make reproducible) + rm -rf \ + /usr/local/go/.git* \ + /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" \ + ; \ + \ +# clamp timestamps for reproducibility (allows "COPY --link" to be more clever/useful) + touch -t "$touchy" /usr/local/.go-date-stamp; \ + find /usr/local/go -depth -newer /usr/local/.go-date-stamp -exec touch -ht "$touchy" '{}' +; \ + rm /usr/local/.go-date-stamp; \ + ); \ + \ +# ideally at this point, we would just "COPY --link ... /usr/local/go/ /usr/local/go/" but BuildKit insists on creating the parent directories (perhaps related to https://github.com/opencontainers/image-spec/pull/970), and does so with unreproducible timestamps, so we instead create a whole new "directory tree" that we can "COPY --link" to accomplish what we want + mkdir /target /target/usr /target/usr/local; \ + mv -vT /usr/local/go /target/usr/local/go; \ + ln -svfT /target/usr/local/go /usr/local/go; \ + touch -t "$touchy" /target/usr/local /target/usr /target; \ + \ + apk del --no-network .fetch-deps; \ + \ +# smoke test + go version; \ +# make sure our reproducibile timestamp is probably still correct (best-effort inline reproducibility test) + epoch="$(stat -c '%Y' /target/usr/local/go)"; \ + [ "$SOURCE_DATE_EPOCH" = "$epoch" ]; \ + find /target -newer /target/usr/local/go -exec sh -c 'ls -ld "$@" && exit "$#"' -- '{}' + + +FROM alpine:3.22 + +RUN apk add --no-cache ca-certificates + +# don't auto-upgrade the gotoolchain +# https://github.com/docker-library/golang/issues/472 +ENV GOTOOLCHAIN=local + +ENV GOPATH /go +ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH +# (see notes above about "COPY --link") +COPY --from=build --link /target/ / +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH" +WORKDIR $GOPATH diff --git a/tip/bookworm/Dockerfile b/tip/bookworm/Dockerfile new file mode 100644 index 00000000..ff81be8a --- /dev/null +++ b/tip/bookworm/Dockerfile @@ -0,0 +1,133 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM buildpack-deps:bookworm-scm AS build + +ENV PATH /usr/local/go/bin:$PATH + +COPY --from=golang:bookworm /usr/local/go /usr/local/goroot-bootstrap + +# tip-20250613: https://github.com/golang/go/tree/96a6e147b2b02b1f070d559cb2c8e1c25c9b78c3 +ARG GOLANG_COMMIT='96a6e147b2b02b1f070d559cb2c8e1c25c9b78c3' +ENV GOLANG_COMMIT $GOLANG_COMMIT + +RUN set -eux; \ + now="$(date '+%s')"; \ + arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ + case "$arch" in \ + 'amd64') \ + export GOAMD64='v1' GOARCH='amd64' GOOS='linux'; \ + ;; \ + 'armel') \ + export GOARCH='arm' GOARM='5' GOOS='linux'; \ + ;; \ + 'armhf') \ + export GOARCH='arm' GOARM='7' GOOS='linux'; \ + ;; \ + 'arm64') \ + export GOARCH='arm64' GOARM64='v8.0' GOOS='linux'; \ + ;; \ + 'i386') \ + export GO386='softfloat' GOARCH='386' GOOS='linux'; \ + ;; \ + 'mips64el') \ + export GOARCH='mips64le' GOOS='linux'; \ + ;; \ + 'ppc64el') \ + export GOARCH='ppc64le' GOOS='linux'; \ + ;; \ + 'riscv64') \ + export GOARCH='riscv64' GOOS='linux' GORISCV64='rva20u64'; \ + ;; \ + 's390x') \ + export GOARCH='s390x' GOOS='linux'; \ + ;; \ + *) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \ + esac; \ + \ +# before we get too far, let's validate that our "bootstrap" Go works + export GOROOT_BOOTSTRAP=/usr/local/goroot-bootstrap; \ + "$GOROOT_BOOTSTRAP/bin/go" version; \ + \ + git init --quiet /usr/local/go; \ + git -C /usr/local/go fetch --depth 1 https://github.com/golang/go.git "$GOLANG_COMMIT:"; \ + git -C /usr/local/go checkout --quiet FETCH_HEAD; \ + \ +# save the Git timestamp so we can use it for reproducibility + SOURCE_DATE_EPOCH="$(git -C /usr/local/go log -1 --format='format:%ct' HEAD)"; \ + export SOURCE_DATE_EPOCH; \ + touchy="$(date -d "@$SOURCE_DATE_EPOCH" '+%Y%m%d%H%M.%S')"; \ +# for logging validation/edification + date --date "@$SOURCE_DATE_EPOCH" --rfc-2822; \ +# sanity check (detected value should be older than our wall clock) + [ "$SOURCE_DATE_EPOCH" -lt "$now" ]; \ + \ + ( \ + export \ + GOCACHE='/tmp/gocache' \ +# set GOHOST* to make sure explicitly 32bit builds on 64bit infra work correctly + GOHOSTOS="$GOOS" \ + GOHOSTARCH="$GOARCH" \ + ; \ + \ + cd /usr/local/go/src; \ + ./make.bash; \ + \ +# remove a few intermediate / bootstrapping files the official binary release tarballs do not contain (and ".git" that is hard to make reproducible) + rm -rf \ + /usr/local/go/.git* \ + /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" \ + ; \ + \ +# clamp timestamps for reproducibility (allows "COPY --link" to be more clever/useful) + touch -t "$touchy" /usr/local/.go-date-stamp; \ + find /usr/local/go -depth -newer /usr/local/.go-date-stamp -exec touch -ht "$touchy" '{}' +; \ + rm /usr/local/.go-date-stamp; \ + ); \ + \ +# ideally at this point, we would just "COPY --link ... /usr/local/go/ /usr/local/go/" but BuildKit insists on creating the parent directories (perhaps related to https://github.com/opencontainers/image-spec/pull/970), and does so with unreproducible timestamps, so we instead create a whole new "directory tree" that we can "COPY --link" to accomplish what we want + mkdir /target /target/usr /target/usr/local; \ + mv -vT /usr/local/go /target/usr/local/go; \ + ln -svfT /target/usr/local/go /usr/local/go; \ + touch -t "$touchy" /target/usr/local /target/usr /target; \ + \ +# smoke test + go version; \ +# make sure our reproducibile timestamp is probably still correct (best-effort inline reproducibility test) + epoch="$(stat -c '%Y' /target/usr/local/go)"; \ + [ "$SOURCE_DATE_EPOCH" = "$epoch" ]; \ + find /target -newer /target/usr/local/go -exec sh -c 'ls -ld "$@" && exit "$#"' -- '{}' + + +FROM buildpack-deps:bookworm-scm + +# install cgo-related dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + g++ \ + gcc \ + libc6-dev \ + make \ + pkg-config \ + ; \ + rm -rf /var/lib/apt/lists/* + +# don't auto-upgrade the gotoolchain +# https://github.com/docker-library/golang/issues/472 +ENV GOTOOLCHAIN=local + +ENV GOPATH /go +ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH +# (see notes above about "COPY --link") +COPY --from=build --link /target/ / +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH" +WORKDIR $GOPATH diff --git a/tip/bullseye/Dockerfile b/tip/bullseye/Dockerfile new file mode 100644 index 00000000..8f850da7 --- /dev/null +++ b/tip/bullseye/Dockerfile @@ -0,0 +1,133 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM buildpack-deps:bullseye-scm AS build + +ENV PATH /usr/local/go/bin:$PATH + +COPY --from=golang:bullseye /usr/local/go /usr/local/goroot-bootstrap + +# tip-20250613: https://github.com/golang/go/tree/96a6e147b2b02b1f070d559cb2c8e1c25c9b78c3 +ARG GOLANG_COMMIT='96a6e147b2b02b1f070d559cb2c8e1c25c9b78c3' +ENV GOLANG_COMMIT $GOLANG_COMMIT + +RUN set -eux; \ + now="$(date '+%s')"; \ + arch="$(dpkg --print-architecture)"; arch="${arch##*-}"; \ + case "$arch" in \ + 'amd64') \ + export GOAMD64='v1' GOARCH='amd64' GOOS='linux'; \ + ;; \ + 'armel') \ + export GOARCH='arm' GOARM='5' GOOS='linux'; \ + ;; \ + 'armhf') \ + export GOARCH='arm' GOARM='7' GOOS='linux'; \ + ;; \ + 'arm64') \ + export GOARCH='arm64' GOARM64='v8.0' GOOS='linux'; \ + ;; \ + 'i386') \ + export GO386='softfloat' GOARCH='386' GOOS='linux'; \ + ;; \ + 'mips64el') \ + export GOARCH='mips64le' GOOS='linux'; \ + ;; \ + 'ppc64el') \ + export GOARCH='ppc64le' GOOS='linux'; \ + ;; \ + 'riscv64') \ + export GOARCH='riscv64' GOOS='linux' GORISCV64='rva20u64'; \ + ;; \ + 's390x') \ + export GOARCH='s390x' GOOS='linux'; \ + ;; \ + *) echo >&2 "error: unsupported architecture '$arch' (likely packaging update needed)"; exit 1 ;; \ + esac; \ + \ +# before we get too far, let's validate that our "bootstrap" Go works + export GOROOT_BOOTSTRAP=/usr/local/goroot-bootstrap; \ + "$GOROOT_BOOTSTRAP/bin/go" version; \ + \ + git init --quiet /usr/local/go; \ + git -C /usr/local/go fetch --depth 1 https://github.com/golang/go.git "$GOLANG_COMMIT:"; \ + git -C /usr/local/go checkout --quiet FETCH_HEAD; \ + \ +# save the Git timestamp so we can use it for reproducibility + SOURCE_DATE_EPOCH="$(git -C /usr/local/go log -1 --format='format:%ct' HEAD)"; \ + export SOURCE_DATE_EPOCH; \ + touchy="$(date -d "@$SOURCE_DATE_EPOCH" '+%Y%m%d%H%M.%S')"; \ +# for logging validation/edification + date --date "@$SOURCE_DATE_EPOCH" --rfc-2822; \ +# sanity check (detected value should be older than our wall clock) + [ "$SOURCE_DATE_EPOCH" -lt "$now" ]; \ + \ + ( \ + export \ + GOCACHE='/tmp/gocache' \ +# set GOHOST* to make sure explicitly 32bit builds on 64bit infra work correctly + GOHOSTOS="$GOOS" \ + GOHOSTARCH="$GOARCH" \ + ; \ + \ + cd /usr/local/go/src; \ + ./make.bash; \ + \ +# remove a few intermediate / bootstrapping files the official binary release tarballs do not contain (and ".git" that is hard to make reproducible) + rm -rf \ + /usr/local/go/.git* \ + /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" \ + ; \ + \ +# clamp timestamps for reproducibility (allows "COPY --link" to be more clever/useful) + touch -t "$touchy" /usr/local/.go-date-stamp; \ + find /usr/local/go -depth -newer /usr/local/.go-date-stamp -exec touch -ht "$touchy" '{}' +; \ + rm /usr/local/.go-date-stamp; \ + ); \ + \ +# ideally at this point, we would just "COPY --link ... /usr/local/go/ /usr/local/go/" but BuildKit insists on creating the parent directories (perhaps related to https://github.com/opencontainers/image-spec/pull/970), and does so with unreproducible timestamps, so we instead create a whole new "directory tree" that we can "COPY --link" to accomplish what we want + mkdir /target /target/usr /target/usr/local; \ + mv -vT /usr/local/go /target/usr/local/go; \ + ln -svfT /target/usr/local/go /usr/local/go; \ + touch -t "$touchy" /target/usr/local /target/usr /target; \ + \ +# smoke test + go version; \ +# make sure our reproducibile timestamp is probably still correct (best-effort inline reproducibility test) + epoch="$(stat -c '%Y' /target/usr/local/go)"; \ + [ "$SOURCE_DATE_EPOCH" = "$epoch" ]; \ + find /target -newer /target/usr/local/go -exec sh -c 'ls -ld "$@" && exit "$#"' -- '{}' + + +FROM buildpack-deps:bullseye-scm + +# install cgo-related dependencies +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + g++ \ + gcc \ + libc6-dev \ + make \ + pkg-config \ + ; \ + rm -rf /var/lib/apt/lists/* + +# don't auto-upgrade the gotoolchain +# https://github.com/docker-library/golang/issues/472 +ENV GOTOOLCHAIN=local + +ENV GOPATH /go +ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH +# (see notes above about "COPY --link") +COPY --from=build --link /target/ / +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH" +WORKDIR $GOPATH diff --git a/versions.json b/versions.json index 6c6c3dc9..f730dc14 100644 --- a/versions.json +++ b/versions.json @@ -1,566 +1,1320 @@ { - "1.20": { + "1.25-rc": { + "version": "1.25rc1", "arches": { + "aix-ppc64": { + "url": "https://dl.google.com/go/go1.25rc1.aix-ppc64.tar.gz", + "sha256": "a3106aca14507fb86270331c96cf5db397cfaf3ec0d3cfe8208b2b5715d1666f", + "env": { + "GOOS": "aix", + "GOARCH": "ppc64" + }, + "supported": false + }, "amd64": { + "url": "https://dl.google.com/go/go1.25rc1.linux-amd64.tar.gz", + "sha256": "7588a720e243e4672e0dc1c7942ec7592d480a80440fa2829be8b22c9c44a5b7", "env": { - "GOAMD64": "v1", + "GOOS": "linux", "GOARCH": "amd64", - "GOOS": "linux" + "GOAMD64": "v1" }, - "sha256": "ef79a11aa095a08772d2a69e4f152f897c4e96ee297b0dc20264b7dec2961abe", - "supported": true, - "url": "https://dl.google.com/go/go1.20.11.linux-amd64.tar.gz" + "supported": true }, "arm32v5": { "env": { + "GOOS": "linux", "GOARCH": "arm", - "GOARM": "5", - "GOOS": "linux" + "GOARM": "5" }, - "supported": true + "supported": false }, "arm32v6": { + "url": "https://dl.google.com/go/go1.25rc1.linux-armv6l.tar.gz", + "sha256": "96a18398bc2bbbb2a144e0f30c431a1508351d43c1b1194c7647ca4a967dbc69", "env": { + "GOOS": "linux", "GOARCH": "arm", - "GOARM": "6", - "GOOS": "linux" + "GOARM": "6" }, - "sha256": "636a1b4d75c739f4d6373b36d7d278e25523141d4d69eb1bde5526ed56a49635", - "supported": true, - "url": "https://dl.google.com/go/go1.20.11.linux-armv6l.tar.gz" + "supported": true }, "arm32v7": { + "url": "https://dl.google.com/go/go1.25rc1.linux-armv6l.tar.gz", + "sha256": "96a18398bc2bbbb2a144e0f30c431a1508351d43c1b1194c7647ca4a967dbc69", "env": { + "GOOS": "linux", "GOARCH": "arm", - "GOARM": "7", - "GOOS": "linux" + "GOARM": "7" }, - "sha256": "636a1b4d75c739f4d6373b36d7d278e25523141d4d69eb1bde5526ed56a49635", - "supported": true, - "url": "https://dl.google.com/go/go1.20.11.linux-armv6l.tar.gz" + "supported": true }, "arm64v8": { + "url": "https://dl.google.com/go/go1.25rc1.linux-arm64.tar.gz", + "sha256": "ee0b82bc1421c66f3f322a214218b423beddb64182e0105dbff142e777e96fc1", "env": { + "GOOS": "linux", "GOARCH": "arm64", - "GOOS": "linux" + "GOARM64": "v8.0" }, - "sha256": "7908a49c6ce9d48af9b5ba76ccaa0769da45d8b635259a01065b3739acef4ada", - "supported": true, - "url": "https://dl.google.com/go/go1.20.11.linux-arm64.tar.gz" + "supported": true }, "darwin-amd64": { + "url": "https://dl.google.com/go/go1.25rc1.darwin-amd64.tar.gz", + "sha256": "1c0ba988b1457f845bcb3d7efedf4f2fed072fc0d5cad64b90091513df9530d5", "env": { - "GOARCH": "amd64", - "GOOS": "darwin" + "GOOS": "darwin", + "GOARCH": "amd64" }, - "sha256": "ced1b5cfd4e8aa7aff5e6a399ed111e5ed2903ee17aaa79ac0c93565fb229776", - "supported": false, - "url": "https://dl.google.com/go/go1.20.11.darwin-amd64.tar.gz" + "supported": false }, "darwin-arm64v8": { + "url": "https://dl.google.com/go/go1.25rc1.darwin-arm64.tar.gz", + "sha256": "8df00c64e37e13270add03560ba2f11a7e2c498ae1e122065f694d79682c05d4", "env": { - "GOARCH": "arm64", - "GOOS": "darwin" + "GOOS": "darwin", + "GOARCH": "arm64" + }, + "supported": false + }, + "dragonfly-amd64": { + "url": "https://dl.google.com/go/go1.25rc1.dragonfly-amd64.tar.gz", + "sha256": "b32e68e7aace25a6310ea895ded554f787cfd935ffd5b1db9185e362f9039e8a", + "env": { + "GOOS": "dragonfly", + "GOARCH": "amd64" }, - "sha256": "9c29373ae278dc02c1d8a08465eea8490bb09bea4ba88fce79b01fe75f84961c", - "supported": false, - "url": "https://dl.google.com/go/go1.20.11.darwin-arm64.tar.gz" + "supported": false }, "freebsd-amd64": { + "url": "https://dl.google.com/go/go1.25rc1.freebsd-amd64.tar.gz", + "sha256": "ad7c5df8c8e30a14bcf01c00e07e87325c07099f592eb1fd14b2710597d24a8e", "env": { - "GOARCH": "amd64", - "GOOS": "freebsd" + "GOOS": "freebsd", + "GOARCH": "amd64" }, - "sha256": "af07dd2b8d8e69c88cad8994e2a82570d64409c447b6e32fa0a7132aca8a8f12", - "supported": false, - "url": "https://dl.google.com/go/go1.20.11.freebsd-amd64.tar.gz" + "supported": false + }, + "freebsd-arm": { + "url": "https://dl.google.com/go/go1.25rc1.freebsd-arm.tar.gz", + "sha256": "ebd68b49fe47bf037c86e9a73ed99c38f38c5d7caab690ba994f79bd7e2d567b", + "env": { + "GOOS": "freebsd", + "GOARCH": "arm" + }, + "supported": false + }, + "freebsd-arm64v8": { + "url": "https://dl.google.com/go/go1.25rc1.freebsd-arm64.tar.gz", + "sha256": "5351def99069bef3e04d359315c67aa752cf5fa4ffdbcafda4bfbd1a955605ef", + "env": { + "GOOS": "freebsd", + "GOARCH": "arm64" + }, + "supported": false }, "freebsd-i386": { + "url": "https://dl.google.com/go/go1.25rc1.freebsd-386.tar.gz", + "sha256": "87b0efcff938e29b3d2b3347c9d5ea65a5b95b56f0fec6ca283275473e8c1461", "env": { - "GOARCH": "386", - "GOOS": "freebsd" + "GOOS": "freebsd", + "GOARCH": "386" }, - "sha256": "24fd8b234f64e11d49a37f15be346d733a73e0cd082055faf8dad4352754d4a8", - "supported": false, - "url": "https://dl.google.com/go/go1.20.11.freebsd-386.tar.gz" + "supported": false + }, + "freebsd-riscv64": { + "url": "https://dl.google.com/go/go1.25rc1.freebsd-riscv64.tar.gz", + "sha256": "c4f46e579af4562840ae4a175ab7e5efcb71707498944e780ebffb389967be39", + "env": { + "GOOS": "freebsd", + "GOARCH": "riscv64" + }, + "supported": false }, "i386": { + "url": "https://dl.google.com/go/go1.25rc1.linux-386.tar.gz", + "sha256": "4fb3aee891b70edee4423fb457546a30341a7b112c38594af4ee5f6db77ac376", "env": { - "GO386": "softfloat", + "GOOS": "linux", "GOARCH": "386", - "GOOS": "linux" + "GO386": "softfloat" + }, + "supported": true + }, + "illumos-amd64": { + "url": "https://dl.google.com/go/go1.25rc1.illumos-amd64.tar.gz", + "sha256": "2e2d792ae936554f8041995713acc21ce27d6c3ba8ef842e30c9345cb7b64258", + "env": { + "GOOS": "illumos", + "GOARCH": "amd64" }, - "sha256": "168b11bbc30f5a18671412fb9535ede76b3d98389be01ba37319635eea76de24", - "supported": true, - "url": "https://dl.google.com/go/go1.20.11.linux-386.tar.gz" + "supported": false + }, + "loong64": { + "url": "https://dl.google.com/go/go1.25rc1.linux-loong64.tar.gz", + "sha256": "45ea7475fbd63ec5c46be274af0f8e8145a2980d353b83312b28b57380c89259", + "env": { + "GOOS": "linux", + "GOARCH": "loong64" + }, + "supported": false + }, + "mips": { + "url": "https://dl.google.com/go/go1.25rc1.linux-mips.tar.gz", + "sha256": "9b54f599d2706c2659e7f2d7a10661367aea87bd5557641a5047a87dc3c3953c", + "env": { + "GOOS": "linux", + "GOARCH": "mips" + }, + "supported": false + }, + "mips64": { + "url": "https://dl.google.com/go/go1.25rc1.linux-mips64.tar.gz", + "sha256": "0e5f0feaaa08052b77ed3c3d322326320dc60b43d992cd2c5bfc50bfcdc81d6c", + "env": { + "GOOS": "linux", + "GOARCH": "mips64" + }, + "supported": false }, "mips64le": { + "url": "https://dl.google.com/go/go1.25rc1.linux-mips64le.tar.gz", + "sha256": "0808bdcdb389e2f695dd147089d889f93749adfa17c0c11a8dee9f32abd3c616", "env": { - "GOARCH": "mips64le", - "GOOS": "linux" + "GOOS": "linux", + "GOARCH": "mips64le" }, "supported": true }, + "mipsle": { + "url": "https://dl.google.com/go/go1.25rc1.linux-mipsle.tar.gz", + "sha256": "9ffb753be5aef22a57a426d70684ee20ace0c3c2bb9c163444aa29f1d8ec6f2e", + "env": { + "GOOS": "linux", + "GOARCH": "mipsle" + }, + "supported": false + }, + "netbsd-amd64": { + "url": "https://dl.google.com/go/go1.25rc1.netbsd-amd64.tar.gz", + "sha256": "f144a073779cca76cedbefb2257167a27d4b59f8769c336159c876d096454b20", + "env": { + "GOOS": "netbsd", + "GOARCH": "amd64" + }, + "supported": false + }, + "netbsd-arm": { + "url": "https://dl.google.com/go/go1.25rc1.netbsd-arm.tar.gz", + "sha256": "eb6e307d793648c3d2fae8d9ee65a5d504b1dcd347f08d7d2972333074208b04", + "env": { + "GOOS": "netbsd", + "GOARCH": "arm" + }, + "supported": false + }, + "netbsd-arm64v8": { + "url": "https://dl.google.com/go/go1.25rc1.netbsd-arm64.tar.gz", + "sha256": "cfb5558c2da6f891e24eb7d9a20db86755ea4f6c20f8904d355d04ceb95e7355", + "env": { + "GOOS": "netbsd", + "GOARCH": "arm64" + }, + "supported": false + }, + "netbsd-i386": { + "url": "https://dl.google.com/go/go1.25rc1.netbsd-386.tar.gz", + "sha256": "7434ad805139ca7bcea750fc56215f129ea80ec28a52731f42a9b85c45758f00", + "env": { + "GOOS": "netbsd", + "GOARCH": "386" + }, + "supported": false + }, + "openbsd-amd64": { + "url": "https://dl.google.com/go/go1.25rc1.openbsd-amd64.tar.gz", + "sha256": "17fe906de7ccebc6914dc5365b1d893e04ff66fb61b5a7775c36967492b79952", + "env": { + "GOOS": "openbsd", + "GOARCH": "amd64" + }, + "supported": false + }, + "openbsd-arm": { + "url": "https://dl.google.com/go/go1.25rc1.openbsd-arm.tar.gz", + "sha256": "a6af95be1be9efe3af3a3e3e7a3a00b513d9805e0a205c2d56ca004e191a3e20", + "env": { + "GOOS": "openbsd", + "GOARCH": "arm" + }, + "supported": false + }, + "openbsd-arm64v8": { + "url": "https://dl.google.com/go/go1.25rc1.openbsd-arm64.tar.gz", + "sha256": "f283a9a6022881ba752ba618788f3ad1c3c0971e0170b50bc9543f522ec6c592", + "env": { + "GOOS": "openbsd", + "GOARCH": "arm64" + }, + "supported": false + }, + "openbsd-i386": { + "url": "https://dl.google.com/go/go1.25rc1.openbsd-386.tar.gz", + "sha256": "3fd073280ede7161950f1051ba3fe8248214b03d080824fd3c725c8031a006b0", + "env": { + "GOOS": "openbsd", + "GOARCH": "386" + }, + "supported": false + }, + "openbsd-ppc64": { + "url": "https://dl.google.com/go/go1.25rc1.openbsd-ppc64.tar.gz", + "sha256": "9ba621ed83be8a542408b652ecfb4a1a0de61e85bb4d1e69b829eafb4fc2fc72", + "env": { + "GOOS": "openbsd", + "GOARCH": "ppc64" + }, + "supported": false + }, + "openbsd-riscv64": { + "url": "https://dl.google.com/go/go1.25rc1.openbsd-riscv64.tar.gz", + "sha256": "b6401b05bb8294f7723ace6af3d8ce0be743860105b74895564fd69e2941532b", + "env": { + "GOOS": "openbsd", + "GOARCH": "riscv64" + }, + "supported": false + }, + "plan9-amd64": { + "url": "https://dl.google.com/go/go1.25rc1.plan9-amd64.tar.gz", + "sha256": "8bdf474637a5a7268873c9de4b5dea0730e482908e36830afe21daf914d24cd0", + "env": { + "GOOS": "plan9", + "GOARCH": "amd64" + }, + "supported": false + }, + "plan9-arm": { + "url": "https://dl.google.com/go/go1.25rc1.plan9-arm.tar.gz", + "sha256": "2872acf0f7a44ad3b295efb1f998c48d9c89a0444449da7f3f8c012b073db9c8", + "env": { + "GOOS": "plan9", + "GOARCH": "arm" + }, + "supported": false + }, + "plan9-i386": { + "url": "https://dl.google.com/go/go1.25rc1.plan9-386.tar.gz", + "sha256": "91f2f973ef26986033b597b4bdc2ba6492710d37fc0fce59a92fb3a0c43829d9", + "env": { + "GOOS": "plan9", + "GOARCH": "386" + }, + "supported": false + }, + "ppc64": { + "url": "https://dl.google.com/go/go1.25rc1.linux-ppc64.tar.gz", + "sha256": "d197cc5a24b62dcf9537f5c097629e3834ebdc40ffb3c230c0cfad5aebc00862", + "env": { + "GOOS": "linux", + "GOARCH": "ppc64" + }, + "supported": false + }, "ppc64le": { + "url": "https://dl.google.com/go/go1.25rc1.linux-ppc64le.tar.gz", + "sha256": "1ffd0793a1288854e73096c673597854d30d065f18dc5803f39b8c729aa65f7b", "env": { - "GOARCH": "ppc64le", - "GOOS": "linux" + "GOOS": "linux", + "GOARCH": "ppc64le" }, - "sha256": "e04676e1aeafe7c415176f330322d43a4be5ea6deb14aca49905bd1449dc7072", - "supported": true, - "url": "https://dl.google.com/go/go1.20.11.linux-ppc64le.tar.gz" + "supported": true }, "riscv64": { + "url": "https://dl.google.com/go/go1.25rc1.linux-riscv64.tar.gz", + "sha256": "3e5fbc8fdc44a8bbd1b2393a6cc369eb6f43f99d424e0b01b1e38977989239fd", "env": { + "GOOS": "linux", "GOARCH": "riscv64", - "GOOS": "linux" + "GORISCV64": "rva20u64" }, "supported": true }, "s390x": { + "url": "https://dl.google.com/go/go1.25rc1.linux-s390x.tar.gz", + "sha256": "bfcea7cc93ab874185ef6c66a66dacc34ab01dbd03c4d0e5aad3d360c1a6c324", "env": { - "GOARCH": "s390x", - "GOOS": "linux" + "GOOS": "linux", + "GOARCH": "s390x" }, - "sha256": "6112113758b7994249db5d33c34723cd2b2f96d0d80ece07c0e59a91e45912db", - "supported": true, - "url": "https://dl.google.com/go/go1.20.11.linux-s390x.tar.gz" + "supported": true + }, + "solaris-amd64": { + "url": "https://dl.google.com/go/go1.25rc1.solaris-amd64.tar.gz", + "sha256": "f5f78ec2d441ca5356f2151aaa703586000184b134dc11784083ba87f7af3986", + "env": { + "GOOS": "solaris", + "GOARCH": "amd64" + }, + "supported": false }, "src": { - "sha256": "d355c5ae3a8f7763c9ec9dc25153aae373958cbcb60dd09e91a8b56c7621b2fc", - "supported": true, - "url": "https://dl.google.com/go/go1.20.11.src.tar.gz" + "url": "https://dl.google.com/go/go1.25rc1.src.tar.gz", + "sha256": "0cd6772fe133a784fbb7a09d6da3089897fef48d03a21721434bf88188a58629", + "supported": false }, "windows-amd64": { + "url": "https://dl.google.com/go/go1.25rc1.windows-amd64.zip", + "sha256": "0879e884a1300034f7ae48180b12a9fedec861c2c2f94b9af4b6604cf06cc9d7", "env": { - "GOARCH": "amd64", - "GOOS": "windows" + "GOOS": "windows", + "GOARCH": "amd64" }, - "sha256": "53bbae25fb40e316c2e7752be842d9825e3d85e2f33d349cb8b28c5cb747bf3e", - "supported": true, - "url": "https://dl.google.com/go/go1.20.11.windows-amd64.zip" + "supported": true }, "windows-arm64v8": { + "url": "https://dl.google.com/go/go1.25rc1.windows-arm64.zip", + "sha256": "0132bb16ff17cb50e71349cc43e563cf145a356302763d8267e888c77f53a4aa", "env": { - "GOARCH": "arm64", - "GOOS": "windows" + "GOOS": "windows", + "GOARCH": "arm64" }, - "sha256": "0ea5927307faba7e74042b0bb13e049cefcf63a8e338e2d9b61af81d25bcd9df", - "supported": false, - "url": "https://dl.google.com/go/go1.20.11.windows-arm64.zip" + "supported": false }, "windows-i386": { + "url": "https://dl.google.com/go/go1.25rc1.windows-386.zip", + "sha256": "bc1b3b6e4c328f72f72ab50e48db32e761628f728b9b4f033cd4e00788d99546", + "env": { + "GOOS": "windows", + "GOARCH": "386" + }, + "supported": false + } + }, + "variants": [ + "bookworm", + "bullseye", + "alpine3.22", + "alpine3.21", + "windows/windowsservercore-ltsc2025", + "windows/windowsservercore-ltsc2022" + ] + }, + "1.24": { + "version": "1.24.4", + "arches": { + "aix-ppc64": { + "url": "https://dl.google.com/go/go1.24.4.aix-ppc64.tar.gz", + "sha256": "0d2af78e3b6e08f8013dbbdb26ae33052697b6b72e03ec17d496739c2a1aed68", + "env": { + "GOOS": "aix", + "GOARCH": "ppc64" + }, + "supported": false + }, + "amd64": { + "url": "https://dl.google.com/go/go1.24.4.linux-amd64.tar.gz", + "sha256": "77e5da33bb72aeaef1ba4418b6fe511bc4d041873cbf82e5aa6318740df98717", + "env": { + "GOOS": "linux", + "GOARCH": "amd64", + "GOAMD64": "v1" + }, + "supported": true + }, + "arm32v5": { + "env": { + "GOOS": "linux", + "GOARCH": "arm", + "GOARM": "5" + }, + "supported": false + }, + "arm32v6": { + "url": "https://dl.google.com/go/go1.24.4.linux-armv6l.tar.gz", + "sha256": "6a554e32301cecae3162677e66d4264b81b3b1a89592dd1b7b5c552c7a49fe37", + "env": { + "GOOS": "linux", + "GOARCH": "arm", + "GOARM": "6" + }, + "supported": true + }, + "arm32v7": { + "url": "https://dl.google.com/go/go1.24.4.linux-armv6l.tar.gz", + "sha256": "6a554e32301cecae3162677e66d4264b81b3b1a89592dd1b7b5c552c7a49fe37", + "env": { + "GOOS": "linux", + "GOARCH": "arm", + "GOARM": "7" + }, + "supported": true + }, + "arm64v8": { + "url": "https://dl.google.com/go/go1.24.4.linux-arm64.tar.gz", + "sha256": "d5501ee5aca0f258d5fe9bfaed401958445014495dc115f202d43d5210b45241", + "env": { + "GOOS": "linux", + "GOARCH": "arm64", + "GOARM64": "v8.0" + }, + "supported": true + }, + "darwin-amd64": { + "url": "https://dl.google.com/go/go1.24.4.darwin-amd64.tar.gz", + "sha256": "69bef555e114b4a2252452b6e7049afc31fbdf2d39790b669165e89525cd3f5c", "env": { + "GOOS": "darwin", + "GOARCH": "amd64" + }, + "supported": false + }, + "darwin-arm64v8": { + "url": "https://dl.google.com/go/go1.24.4.darwin-arm64.tar.gz", + "sha256": "27973684b515eaf461065054e6b572d9390c05e69ba4a423076c160165336470", + "env": { + "GOOS": "darwin", + "GOARCH": "arm64" + }, + "supported": false + }, + "dragonfly-amd64": { + "url": "https://dl.google.com/go/go1.24.4.dragonfly-amd64.tar.gz", + "sha256": "70b2de9c1cafe5af7be3eb8f80753cce0501ef300db3f3bd59be7ccc464234e1", + "env": { + "GOOS": "dragonfly", + "GOARCH": "amd64" + }, + "supported": false + }, + "freebsd-amd64": { + "url": "https://dl.google.com/go/go1.24.4.freebsd-amd64.tar.gz", + "sha256": "6cbc3ad6cc21bdcc7283824d3ac0e85512c02022f6a35eb2e844882ea6e8448c", + "env": { + "GOOS": "freebsd", + "GOARCH": "amd64" + }, + "supported": false + }, + "freebsd-arm": { + "url": "https://dl.google.com/go/go1.24.4.freebsd-arm.tar.gz", + "sha256": "d49ae050c20aff646a7641dd903f03eb674570790b90ffb298076c4d41e36655", + "env": { + "GOOS": "freebsd", + "GOARCH": "arm" + }, + "supported": false + }, + "freebsd-arm64v8": { + "url": "https://dl.google.com/go/go1.24.4.freebsd-arm64.tar.gz", + "sha256": "e31924abef2a28456b7103c0a5d333dcc11ecf19e76d5de1a383ad5fe0b42457", + "env": { + "GOOS": "freebsd", + "GOARCH": "arm64" + }, + "supported": false + }, + "freebsd-i386": { + "url": "https://dl.google.com/go/go1.24.4.freebsd-386.tar.gz", + "sha256": "8d529839db29ee171505b89dc9c3de76003a4ab56202d84bddbbecacbfb6d7c9", + "env": { + "GOOS": "freebsd", + "GOARCH": "386" + }, + "supported": false + }, + "freebsd-riscv64": { + "url": "https://dl.google.com/go/go1.24.4.freebsd-riscv64.tar.gz", + "sha256": "b5bca135eae8ebddf22972611ac1c58ae9fbb5979fd953cc5245c5b1b2517546", + "env": { + "GOOS": "freebsd", + "GOARCH": "riscv64" + }, + "supported": false + }, + "i386": { + "url": "https://dl.google.com/go/go1.24.4.linux-386.tar.gz", + "sha256": "130c9b061082eca15513e595e9952a2ded32e737e609dd0e49f7dfa74eba026d", + "env": { + "GOOS": "linux", "GOARCH": "386", - "GOOS": "windows" + "GO386": "softfloat" }, - "sha256": "b8ae4c9398964ff14819806816d2303cfdc8dd6b59e32a30dec7dedbe6eb6003", - "supported": false, - "url": "https://dl.google.com/go/go1.20.11.windows-386.zip" + "supported": true + }, + "illumos-amd64": { + "url": "https://dl.google.com/go/go1.24.4.illumos-amd64.tar.gz", + "sha256": "7d5efda511ff7e3114b130acee5d0bffbb078fedbfa9b2c1b6a807107e1ca23a", + "env": { + "GOOS": "illumos", + "GOARCH": "amd64" + }, + "supported": false + }, + "loong64": { + "url": "https://dl.google.com/go/go1.24.4.linux-loong64.tar.gz", + "sha256": "b208eb25fe244408cbe269ed426454bc46e59d0e0a749b6240d39e884e969875", + "env": { + "GOOS": "linux", + "GOARCH": "loong64" + }, + "supported": false + }, + "mips": { + "url": "https://dl.google.com/go/go1.24.4.linux-mips.tar.gz", + "sha256": "fddfcb28fd36fe63d2ae181026798f86f3bbd3a7bb0f1e1f617dd3d604bf3fe4", + "env": { + "GOOS": "linux", + "GOARCH": "mips" + }, + "supported": false + }, + "mips64": { + "url": "https://dl.google.com/go/go1.24.4.linux-mips64.tar.gz", + "sha256": "7934b924d5ab8c8ae3134a09a6ae74d3c39f63f6c4322ec289364dbbf0bac3ca", + "env": { + "GOOS": "linux", + "GOARCH": "mips64" + }, + "supported": false + }, + "mips64le": { + "url": "https://dl.google.com/go/go1.24.4.linux-mips64le.tar.gz", + "sha256": "fa763d8673f94d6e534bb72c3cf675d4c2b8da4a6da42a89f08c5586106db39c", + "env": { + "GOOS": "linux", + "GOARCH": "mips64le" + }, + "supported": true + }, + "mipsle": { + "url": "https://dl.google.com/go/go1.24.4.linux-mipsle.tar.gz", + "sha256": "84363dbfe49b41d43df84420a09bd53a4770053d63bfa509868c46a5f8eb3ff7", + "env": { + "GOOS": "linux", + "GOARCH": "mipsle" + }, + "supported": false + }, + "netbsd-amd64": { + "url": "https://dl.google.com/go/go1.24.4.netbsd-amd64.tar.gz", + "sha256": "370fabcdfee7c18857c96fdd5b706e025d4fb86a208da88ba56b1493b35498e9", + "env": { + "GOOS": "netbsd", + "GOARCH": "amd64" + }, + "supported": false + }, + "netbsd-arm": { + "url": "https://dl.google.com/go/go1.24.4.netbsd-arm.tar.gz", + "sha256": "7935ef95d4d1acc48587b1eb4acab98b0a7d9569736a32398b9c1d2e89026865", + "env": { + "GOOS": "netbsd", + "GOARCH": "arm" + }, + "supported": false + }, + "netbsd-arm64v8": { + "url": "https://dl.google.com/go/go1.24.4.netbsd-arm64.tar.gz", + "sha256": "ead78fd0fa29fbb176cc83f1caa54032e1a44f842affa56a682c647e0759f237", + "env": { + "GOOS": "netbsd", + "GOARCH": "arm64" + }, + "supported": false + }, + "netbsd-i386": { + "url": "https://dl.google.com/go/go1.24.4.netbsd-386.tar.gz", + "sha256": "954b49ccc2cfcf4b5f7cd33ff662295e0d3b74e7590c8e25fc2abb30bce120ba", + "env": { + "GOOS": "netbsd", + "GOARCH": "386" + }, + "supported": false + }, + "openbsd-amd64": { + "url": "https://dl.google.com/go/go1.24.4.openbsd-amd64.tar.gz", + "sha256": "24568da3dcbcdb24ec18b631f072faf0f3763e3d04f79032dc56ad9ec35379c4", + "env": { + "GOOS": "openbsd", + "GOARCH": "amd64" + }, + "supported": false + }, + "openbsd-arm": { + "url": "https://dl.google.com/go/go1.24.4.openbsd-arm.tar.gz", + "sha256": "45abf523f870632417ab007de3841f64dd906bde546ffc8c6380ccbe91c7fb73", + "env": { + "GOOS": "openbsd", + "GOARCH": "arm" + }, + "supported": false + }, + "openbsd-arm64v8": { + "url": "https://dl.google.com/go/go1.24.4.openbsd-arm64.tar.gz", + "sha256": "7c57c69b5dd1e946b28a3034c285240a48e2861bdcb50b7d9c0ed61bcf89c879", + "env": { + "GOOS": "openbsd", + "GOARCH": "arm64" + }, + "supported": false + }, + "openbsd-i386": { + "url": "https://dl.google.com/go/go1.24.4.openbsd-386.tar.gz", + "sha256": "913e217394b851a636b99de175f0c2f9ab9938b41c557f047168f77ee485d776", + "env": { + "GOOS": "openbsd", + "GOARCH": "386" + }, + "supported": false + }, + "openbsd-ppc64": { + "url": "https://dl.google.com/go/go1.24.4.openbsd-ppc64.tar.gz", + "sha256": "91ed711f704829372d6931e1897631ef40288b8f9e3cd6ef4a24df7126d1066a", + "env": { + "GOOS": "openbsd", + "GOARCH": "ppc64" + }, + "supported": false + }, + "openbsd-riscv64": { + "url": "https://dl.google.com/go/go1.24.4.openbsd-riscv64.tar.gz", + "sha256": "de5e270d971c8790e8880168d56a2ea103979927c10ded136d792bbdf9bce3d3", + "env": { + "GOOS": "openbsd", + "GOARCH": "riscv64" + }, + "supported": false + }, + "plan9-amd64": { + "url": "https://dl.google.com/go/go1.24.4.plan9-amd64.tar.gz", + "sha256": "39d6363a43fd16b60ae9ad7346a264e982e4fa653dee3b45f83e03cd2f7a6647", + "env": { + "GOOS": "plan9", + "GOARCH": "amd64" + }, + "supported": false + }, + "plan9-arm": { + "url": "https://dl.google.com/go/go1.24.4.plan9-arm.tar.gz", + "sha256": "1964ae2571259de77b930e97f2891aa92706ff81aac9909d45bb107b0fab16c8", + "env": { + "GOOS": "plan9", + "GOARCH": "arm" + }, + "supported": false + }, + "plan9-i386": { + "url": "https://dl.google.com/go/go1.24.4.plan9-386.tar.gz", + "sha256": "ff429d03f00bcd32a50f445320b8329d0fadb2a2fff899c11e95e0922a82c543", + "env": { + "GOOS": "plan9", + "GOARCH": "386" + }, + "supported": false + }, + "ppc64": { + "url": "https://dl.google.com/go/go1.24.4.linux-ppc64.tar.gz", + "sha256": "28fcbd5d3b56493606873c33f2b4bdd84ba93c633f37313613b5a1e6495c6fe5", + "env": { + "GOOS": "linux", + "GOARCH": "ppc64" + }, + "supported": false + }, + "ppc64le": { + "url": "https://dl.google.com/go/go1.24.4.linux-ppc64le.tar.gz", + "sha256": "9ca4afef813a2578c23843b640ae0290aa54b2e3c950a6cc4c99e16a57dec2ec", + "env": { + "GOOS": "linux", + "GOARCH": "ppc64le" + }, + "supported": true + }, + "riscv64": { + "url": "https://dl.google.com/go/go1.24.4.linux-riscv64.tar.gz", + "sha256": "1d7034f98662d8f2c8abd7c700ada4093acb4f9c00e0e51a30344821d0785c77", + "env": { + "GOOS": "linux", + "GOARCH": "riscv64", + "GORISCV64": "rva20u64" + }, + "supported": true + }, + "s390x": { + "url": "https://dl.google.com/go/go1.24.4.linux-s390x.tar.gz", + "sha256": "0449f3203c39703ab27684be763e9bb78ca9a051e0e4176727aead9461b6deb5", + "env": { + "GOOS": "linux", + "GOARCH": "s390x" + }, + "supported": true + }, + "solaris-amd64": { + "url": "https://dl.google.com/go/go1.24.4.solaris-amd64.tar.gz", + "sha256": "a7f9af424e8fb87886664754badca459513f64f6a321d17f1d219b8edf519821", + "env": { + "GOOS": "solaris", + "GOARCH": "amd64" + }, + "supported": false + }, + "src": { + "url": "https://dl.google.com/go/go1.24.4.src.tar.gz", + "sha256": "5a86a83a31f9fa81490b8c5420ac384fd3d95a3e71fba665c7b3f95d1dfef2b4", + "supported": false + }, + "windows-amd64": { + "url": "https://dl.google.com/go/go1.24.4.windows-amd64.zip", + "sha256": "b751a1136cb9d8a2e7ebb22c538c4f02c09b98138c7c8bfb78a54a4566c013b1", + "env": { + "GOOS": "windows", + "GOARCH": "amd64" + }, + "supported": true + }, + "windows-arm64v8": { + "url": "https://dl.google.com/go/go1.24.4.windows-arm64.zip", + "sha256": "d17da51bc85bd010754a4063215d15d2c033cc289d67ca9201a03c9041b2969d", + "env": { + "GOOS": "windows", + "GOARCH": "arm64" + }, + "supported": false + }, + "windows-i386": { + "url": "https://dl.google.com/go/go1.24.4.windows-386.zip", + "sha256": "d454d3cb144432f1726bf00e28c6017e78ccb256a8d01b8e3fb1b2e6b5650f28", + "env": { + "GOOS": "windows", + "GOARCH": "386" + }, + "supported": false } }, "variants": [ "bookworm", "bullseye", - "alpine3.18", - "alpine3.17", + "alpine3.22", + "alpine3.21", + "windows/windowsservercore-ltsc2025", "windows/windowsservercore-ltsc2022", - "windows/windowsservercore-1809", - "windows/nanoserver-ltsc2022", - "windows/nanoserver-1809" - ], - "version": "1.20.11" + "windows/nanoserver-ltsc2025", + "windows/nanoserver-ltsc2022" + ] }, - "1.21": { + "1.23": { + "version": "1.23.10", "arches": { "aix-ppc64": { + "url": "https://dl.google.com/go/go1.23.10.aix-ppc64.tar.gz", + "sha256": "a21ac5e3c056dd233f14924e833a7baa5568fa857209c7a73c39e3dd327cf449", "env": { - "GOARCH": "ppc64", - "GOOS": "aix" + "GOOS": "aix", + "GOARCH": "ppc64" }, - "sha256": "e714480d33d092c3960663ec9e43ca278c757adba714cb28e954c1b0f430b919", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.aix-ppc64.tar.gz" + "supported": false }, "amd64": { + "url": "https://dl.google.com/go/go1.23.10.linux-amd64.tar.gz", + "sha256": "535f9f81802499f2a7dbfa70abb8fda3793725fcc29460f719815f6e10b5fd60", "env": { - "GOAMD64": "v1", + "GOOS": "linux", "GOARCH": "amd64", - "GOOS": "linux" + "GOAMD64": "v1" }, - "sha256": "73cac0215254d0c7d1241fa40837851f3b9a8a742d0b54714cbdfb3feaf8f0af", - "supported": true, - "url": "https://dl.google.com/go/go1.21.4.linux-amd64.tar.gz" + "supported": true }, "arm32v5": { "env": { + "GOOS": "linux", "GOARCH": "arm", - "GOARM": "5", - "GOOS": "linux" + "GOARM": "5" }, - "supported": true + "supported": false }, "arm32v6": { + "url": "https://dl.google.com/go/go1.23.10.linux-armv6l.tar.gz", + "sha256": "b6e00c9a72406d394b9f167e74670e28b72ed559cca8115b21be1cb9d5316cb4", "env": { + "GOOS": "linux", "GOARCH": "arm", - "GOARM": "6", - "GOOS": "linux" + "GOARM": "6" }, - "sha256": "6c62e89113750cc77c498194d13a03fadfda22bd2c7d44e8a826fd354db60252", - "supported": true, - "url": "https://dl.google.com/go/go1.21.4.linux-armv6l.tar.gz" + "supported": true }, "arm32v7": { + "url": "https://dl.google.com/go/go1.23.10.linux-armv6l.tar.gz", + "sha256": "b6e00c9a72406d394b9f167e74670e28b72ed559cca8115b21be1cb9d5316cb4", "env": { + "GOOS": "linux", "GOARCH": "arm", - "GOARM": "7", - "GOOS": "linux" + "GOARM": "7" }, - "sha256": "6c62e89113750cc77c498194d13a03fadfda22bd2c7d44e8a826fd354db60252", - "supported": true, - "url": "https://dl.google.com/go/go1.21.4.linux-armv6l.tar.gz" + "supported": true }, "arm64v8": { + "url": "https://dl.google.com/go/go1.23.10.linux-arm64.tar.gz", + "sha256": "bfb1f1df7173f44648ee070a39ab0481068632f595305a699d89cd56a33b8081", "env": { + "GOOS": "linux", "GOARCH": "arm64", - "GOOS": "linux" + "GOARM64": "v8.0" }, - "sha256": "ce1983a7289856c3a918e1fd26d41e072cc39f928adfb11ba1896440849b95da", - "supported": true, - "url": "https://dl.google.com/go/go1.21.4.linux-arm64.tar.gz" + "supported": true }, "darwin-amd64": { + "url": "https://dl.google.com/go/go1.23.10.darwin-amd64.tar.gz", + "sha256": "1cbd7af6f07bc6fa1f8672f9b913c961986864100e467e0acdc942e0ae46fe68", "env": { - "GOARCH": "amd64", - "GOOS": "darwin" + "GOOS": "darwin", + "GOARCH": "amd64" }, - "sha256": "cd3bdcc802b759b70e8418bc7afbc4a65ca73a3fe576060af9fc8a2a5e71c3b8", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.darwin-amd64.tar.gz" + "supported": false }, "darwin-arm64v8": { + "url": "https://dl.google.com/go/go1.23.10.darwin-arm64.tar.gz", + "sha256": "25c64bfa8a8fd8e7f62fb54afa4354af8409a4bb2358c2699a1003b733e6fce5", "env": { - "GOARCH": "arm64", - "GOOS": "darwin" + "GOOS": "darwin", + "GOARCH": "arm64" }, - "sha256": "8b7caf2ac60bdff457dba7d4ff2a01def889592b834453431ae3caecf884f6a5", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.darwin-arm64.tar.gz" + "supported": false }, "dragonfly-amd64": { + "url": "https://dl.google.com/go/go1.23.10.dragonfly-amd64.tar.gz", + "sha256": "fa10f30b269cc52e8ea39025eb185e836870a770e55c89f272da5ae3c1d3aad5", "env": { - "GOARCH": "amd64", - "GOOS": "dragonfly" + "GOOS": "dragonfly", + "GOARCH": "amd64" }, - "sha256": "91791237696eda14812359e02e96ebb0940c2fe9d5ec278f0415355a2775c9ce", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.dragonfly-amd64.tar.gz" + "supported": false }, "freebsd-amd64": { + "url": "https://dl.google.com/go/go1.23.10.freebsd-amd64.tar.gz", + "sha256": "926490e5c21f229ace329d93d7b9e1cbd787fb5ca4deb5cfc6f0f6849a585887", "env": { - "GOARCH": "amd64", - "GOOS": "freebsd" + "GOOS": "freebsd", + "GOARCH": "amd64" }, - "sha256": "59f9b32187efb98d344a3818a631d3815ebb5c7bbefc367bab6515caaca544e9", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.freebsd-amd64.tar.gz" + "supported": false }, - "freebsd-arm32v6": { + "freebsd-arm": { + "url": "https://dl.google.com/go/go1.23.10.freebsd-arm.tar.gz", + "sha256": "9f08d36dfaf0158d08154a7f8287792eb119df183da4e17ba3e9103ed6ce0ae9", "env": { - "GOARCH": "armv6l", - "GOOS": "freebsd" + "GOOS": "freebsd", + "GOARCH": "arm" }, - "sha256": "2801a1310e7325f1093ad0faa303517b4d892312e50686a21034322ef34011a8", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.freebsd-arm.tar.gz" + "supported": false }, "freebsd-arm64v8": { + "url": "https://dl.google.com/go/go1.23.10.freebsd-arm64.tar.gz", + "sha256": "441d73c73759e011c2a2490f3e3ec4bffa6ca698f73d8f3a40736f3f5ee3b6a8", "env": { - "GOARCH": "arm64", - "GOOS": "freebsd" + "GOOS": "freebsd", + "GOARCH": "arm64" }, - "sha256": "8c6da65429a06f99e150fa8432da97052a2a78412a01761ada51eff08596c666", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.freebsd-arm64.tar.gz" + "supported": false }, "freebsd-i386": { + "url": "https://dl.google.com/go/go1.23.10.freebsd-386.tar.gz", + "sha256": "5b398be0c699791a4862a9e7be233ff3bef477650ae0ec5dd9f61a6961104c93", "env": { - "GOARCH": "386", - "GOOS": "freebsd" + "GOOS": "freebsd", + "GOARCH": "386" }, - "sha256": "f1e685d086eb36f4be5b8b953b52baf7752bc6235400d84bb7d87e500b65f03e", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.freebsd-386.tar.gz" + "supported": false }, "freebsd-riscv64": { + "url": "https://dl.google.com/go/go1.23.10.freebsd-riscv64.tar.gz", + "sha256": "c818e2a1bf790286842daeb0fe51cad4116cfd22f40b35f54a6960d17267e228", "env": { - "GOARCH": "riscv64", - "GOOS": "freebsd" + "GOOS": "freebsd", + "GOARCH": "riscv64" }, - "sha256": "41df00d21da12a3d50b0a030b5425bad11d340aea037863d7328919df9aa67d8", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.freebsd-riscv64.tar.gz" + "supported": false }, "i386": { + "url": "https://dl.google.com/go/go1.23.10.linux-386.tar.gz", + "sha256": "ded3c0a8d6d2a0ea5e7599c49678efa05cda139d31baaaf7d8d536a9e4cc19b2", "env": { - "GO386": "softfloat", + "GOOS": "linux", "GOARCH": "386", - "GOOS": "linux" + "GO386": "softfloat" }, - "sha256": "64d3e5d295806e137c9e39d1e1f10b00a30fcd5c2f230d72b3298f579bb3c89a", - "supported": true, - "url": "https://dl.google.com/go/go1.21.4.linux-386.tar.gz" + "supported": true }, "illumos-amd64": { + "url": "https://dl.google.com/go/go1.23.10.illumos-amd64.tar.gz", + "sha256": "a0ea62e1a3521a883cbf4c4193120560e9a708dd1901966ae90530571e02e4ef", "env": { - "GOARCH": "amd64", - "GOOS": "illumos" + "GOOS": "illumos", + "GOARCH": "amd64" }, - "sha256": "0d5aaa59038ac5aabe68534f09d5aa663d1f24d0aacfd306be69ff0c31981cef", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.illumos-amd64.tar.gz" + "supported": false }, "loong64": { + "url": "https://dl.google.com/go/go1.23.10.linux-loong64.tar.gz", + "sha256": "98175bc2230509c2a96e9978de3b06fb72afd743768eb547fb7ea51e627cb18c", "env": { - "GOARCH": "loong64", - "GOOS": "linux" + "GOOS": "linux", + "GOARCH": "loong64" }, - "sha256": "5ae2508ff678bee7c1254820d7341ae758e61744941887d7f59a0d9d77d13ab2", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.linux-loong64.tar.gz" + "supported": false }, "mips": { + "url": "https://dl.google.com/go/go1.23.10.linux-mips.tar.gz", + "sha256": "b24f8579ca59c955795edcefd42d5fa262ad9a3c170ca3643cb55846965b21a7", "env": { - "GOARCH": "mips", - "GOOS": "linux" + "GOOS": "linux", + "GOARCH": "mips" }, - "sha256": "f576bbffb41d627b74b5cf93fdd493ad376bb65402e5717337768b1a50afe332", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.linux-mips.tar.gz" + "supported": false }, "mips64": { + "url": "https://dl.google.com/go/go1.23.10.linux-mips64.tar.gz", + "sha256": "307823cb0a8d0356fd245b58cc90c95c08a1ff16f8acac03bf02f6ae0f849d0d", "env": { - "GOARCH": "mips64", - "GOOS": "linux" + "GOOS": "linux", + "GOARCH": "mips64" }, - "sha256": "92974541f44ddf164e615b5a20a61bbdfd2e1116f7609d8ea2a548f1e7427fd1", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.linux-mips64.tar.gz" + "supported": false }, "mips64le": { + "url": "https://dl.google.com/go/go1.23.10.linux-mips64le.tar.gz", + "sha256": "3d9a542d761877bcf46ad7ae900460a6d3d50f4a3691a40c8535128addf45a11", "env": { - "GOARCH": "mips64le", - "GOOS": "linux" + "GOOS": "linux", + "GOARCH": "mips64le" }, - "sha256": "c7ce3a9dcf03322b79beda474c4a0154393d9029b48f7c2e260fb3365c8a6ad3", - "supported": true, - "url": "https://dl.google.com/go/go1.21.4.linux-mips64le.tar.gz" + "supported": true }, "mipsle": { + "url": "https://dl.google.com/go/go1.23.10.linux-mipsle.tar.gz", + "sha256": "e480a7a1667163c81d891bb6291b2b1c1ced62d8bf5fc97547437dee7a40924a", "env": { - "GOARCH": "mipsle", - "GOOS": "linux" + "GOOS": "linux", + "GOARCH": "mipsle" }, - "sha256": "57c3609628fdba72786da03d813b23ebedcd652d071fd40ac8574008fbd05cc5", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.linux-mipsle.tar.gz" + "supported": false }, "netbsd-amd64": { + "url": "https://dl.google.com/go/go1.23.10.netbsd-amd64.tar.gz", + "sha256": "17a0787e08e64446cb0a734522321f93c6ad281dfbecc7d171f5822021d8a05e", "env": { - "GOARCH": "amd64", - "GOOS": "netbsd" + "GOOS": "netbsd", + "GOARCH": "amd64" }, - "sha256": "2710db154816c1ceea6be8091e430571525245de981840af97460be20376594c", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.netbsd-amd64.tar.gz" + "supported": false }, - "netbsd-arm32v6": { + "netbsd-arm": { + "url": "https://dl.google.com/go/go1.23.10.netbsd-arm.tar.gz", + "sha256": "e31954ef3c38cf19a2858e2bcdf78b0fe77454ca0e24bc504b094788dcd4d4a5", "env": { - "GOARCH": "armv6l", - "GOOS": "netbsd" + "GOOS": "netbsd", + "GOARCH": "arm" }, - "sha256": "76afd354d01e7353033ae04e69b0c102c59817d9def7f7cfa2fd32b849a35372", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.netbsd-arm.tar.gz" + "supported": false }, "netbsd-arm64v8": { + "url": "https://dl.google.com/go/go1.23.10.netbsd-arm64.tar.gz", + "sha256": "13ceb6b4297f22b13dae8230a8205799ccdfb5173b7a7efe85009a6dd0d1a84c", "env": { - "GOARCH": "arm64", - "GOOS": "netbsd" + "GOOS": "netbsd", + "GOARCH": "arm64" }, - "sha256": "1af77f0e5713bfbd52b8d0596e56585eb6bbe09f6d5e9e197dc0dbe50bf83536", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.netbsd-arm64.tar.gz" + "supported": false }, "netbsd-i386": { + "url": "https://dl.google.com/go/go1.23.10.netbsd-386.tar.gz", + "sha256": "443e47d30f0eb94e394879b05e078b0f8e1978866e2a01db35aec18ece88d90d", "env": { - "GOARCH": "386", - "GOOS": "netbsd" + "GOOS": "netbsd", + "GOARCH": "386" }, - "sha256": "7a9408f4bf5c0bd8ab27193f412343a57bda33c761a9b3360232468373980628", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.netbsd-386.tar.gz" + "supported": false }, "openbsd-amd64": { + "url": "https://dl.google.com/go/go1.23.10.openbsd-amd64.tar.gz", + "sha256": "8a19847d25c16f52efbd2c00e7669632febaeb06c6dcf775cb16ccf9fa22f910", "env": { - "GOARCH": "amd64", - "GOOS": "openbsd" + "GOOS": "openbsd", + "GOARCH": "amd64" }, - "sha256": "430ec669f36b368f1fb104248f7932df707552e0503e73e83c8e3481cfc9c623", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.openbsd-amd64.tar.gz" + "supported": false }, - "openbsd-arm32v6": { + "openbsd-arm": { + "url": "https://dl.google.com/go/go1.23.10.openbsd-arm.tar.gz", + "sha256": "79b0ebdc59715f87d9ccd3c70361b4f861b276508c506a10e58e61464b74c49c", "env": { - "GOARCH": "armv6l", - "GOOS": "openbsd" + "GOOS": "openbsd", + "GOARCH": "arm" }, - "sha256": "f88596ff208eb57cec96e4604cb5cace8162cfec6fbd9198abf18ff742c39a85", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.openbsd-arm.tar.gz" + "supported": false }, "openbsd-arm64v8": { + "url": "https://dl.google.com/go/go1.23.10.openbsd-arm64.tar.gz", + "sha256": "82c256b94897807a12f205488980f2eee9218ea554e9bd7fa208361c97237862", "env": { - "GOARCH": "arm64", - "GOOS": "openbsd" + "GOOS": "openbsd", + "GOARCH": "arm64" }, - "sha256": "513e52d5f01ef04d24f3c9760fe00070f90bd1f9261220e84a5f30116808e0e8", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.openbsd-arm64.tar.gz" + "supported": false }, "openbsd-i386": { + "url": "https://dl.google.com/go/go1.23.10.openbsd-386.tar.gz", + "sha256": "73bf985dc92ff9acea91b212219746e8d5a5dfa1e26917b2638620b0a1445863", "env": { - "GOARCH": "386", - "GOOS": "openbsd" + "GOOS": "openbsd", + "GOARCH": "386" }, - "sha256": "dd8818867b5f652f43e01b43803279f42da5da219e13416e2f7d8e06fabea630", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.openbsd-386.tar.gz" + "supported": false + }, + "openbsd-ppc64": { + "url": "https://dl.google.com/go/go1.23.10.openbsd-ppc64.tar.gz", + "sha256": "903ad58d419383b4121a707da0e896d94f0cbda850f9d30c3bee7b7aad0f384b", + "env": { + "GOOS": "openbsd", + "GOARCH": "ppc64" + }, + "supported": false + }, + "openbsd-riscv64": { + "url": "https://dl.google.com/go/go1.23.10.openbsd-riscv64.tar.gz", + "sha256": "dd17279a65f5cfb3918d5762ce20368d1a23861ea2e17c0740165a30d1ba844f", + "env": { + "GOOS": "openbsd", + "GOARCH": "riscv64" + }, + "supported": false }, "plan9-amd64": { + "url": "https://dl.google.com/go/go1.23.10.plan9-amd64.tar.gz", + "sha256": "9743e264ef63aa0bd3f0adad728e6a7ebfd198c9a4031a7f71e5db6da3314406", "env": { - "GOARCH": "amd64", - "GOOS": "plan9" + "GOOS": "plan9", + "GOARCH": "amd64" }, - "sha256": "ff2409efab2e3738227613e679ee477ad5329e3fe4abf6ce343748a72a9392bf", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.plan9-amd64.tar.gz" + "supported": false }, - "plan9-arm32v6": { + "plan9-arm": { + "url": "https://dl.google.com/go/go1.23.10.plan9-arm.tar.gz", + "sha256": "06edf10c85499331117ec850d0575c049ddffe3ebe2b38702249487ad0cc02ac", "env": { - "GOARCH": "armv6l", - "GOOS": "plan9" + "GOOS": "plan9", + "GOARCH": "arm" }, - "sha256": "deb8d7e1e04040ec53a8281c41593534172f93069d7398c33ff371b96824687e", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.plan9-arm.tar.gz" + "supported": false }, "plan9-i386": { + "url": "https://dl.google.com/go/go1.23.10.plan9-386.tar.gz", + "sha256": "65b234462bb35a2f1184d3b46513d42c211bd96d76151a1b800f50195686bf94", "env": { - "GOARCH": "386", - "GOOS": "plan9" + "GOOS": "plan9", + "GOARCH": "386" }, - "sha256": "3120f86295792448556dcf5df1f38ba148a1f90f44ee189cba3ce724c76b6a52", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.plan9-386.tar.gz" + "supported": false }, "ppc64": { + "url": "https://dl.google.com/go/go1.23.10.linux-ppc64.tar.gz", + "sha256": "5ea8296b02c214d30287d1c8436f3b1ce217f7f6fac4b9cc750df8148077957a", "env": { - "GOARCH": "ppc64", - "GOOS": "linux" + "GOOS": "linux", + "GOARCH": "ppc64" }, - "sha256": "76b8f2205ac8ff5c617bf28485bcfac2f17d9db743d5be5267d4dc4663205b55", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.linux-ppc64.tar.gz" + "supported": false }, "ppc64le": { + "url": "https://dl.google.com/go/go1.23.10.linux-ppc64le.tar.gz", + "sha256": "8fb94455cfa5e9a5e8af2bfbc7323a6fed2dabaffda1a69dae5dd41b669bbb57", "env": { - "GOARCH": "ppc64le", - "GOOS": "linux" + "GOOS": "linux", + "GOARCH": "ppc64le" }, - "sha256": "2c63b36d2adcfb22013102a2ee730f058ec2f93b9f27479793c80b2e3641783f", - "supported": true, - "url": "https://dl.google.com/go/go1.21.4.linux-ppc64le.tar.gz" + "supported": true }, "riscv64": { + "url": "https://dl.google.com/go/go1.23.10.linux-riscv64.tar.gz", + "sha256": "ed68dbd165b2d2bf3725239a5bad852493b0de8ea45fa7a585159a63e0e1194a", "env": { + "GOOS": "linux", "GOARCH": "riscv64", - "GOOS": "linux" + "GORISCV64": "rva20u64" }, - "sha256": "9695edd2109544b364daddb32816f5c7980f1f48b8490c51fa2c167f5b2eca48", - "supported": true, - "url": "https://dl.google.com/go/go1.21.4.linux-riscv64.tar.gz" + "supported": true }, "s390x": { + "url": "https://dl.google.com/go/go1.23.10.linux-s390x.tar.gz", + "sha256": "7d0e8651eb54fce5cfe2d4b412ddfa50144ce21907f72192a6549ffe03db4e1f", "env": { - "GOARCH": "s390x", - "GOOS": "linux" + "GOOS": "linux", + "GOARCH": "s390x" }, - "sha256": "7a75ba4afc7a96058ca65903d994cd862381825d7dca12b2183f087c757c26c0", - "supported": true, - "url": "https://dl.google.com/go/go1.21.4.linux-s390x.tar.gz" + "supported": true }, "solaris-amd64": { + "url": "https://dl.google.com/go/go1.23.10.solaris-amd64.tar.gz", + "sha256": "9f69f422caa8944c562f5312159b422e6cb12b95d42e9fc861667f1a07cbba6e", "env": { - "GOARCH": "amd64", - "GOOS": "solaris" + "GOOS": "solaris", + "GOARCH": "amd64" }, - "sha256": "2240e5f45ac790dbb7a384e7094697d7104067c16053790693378d424bce840f", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.solaris-amd64.tar.gz" + "supported": false }, "src": { - "sha256": "47b26a83d2b65a3c1c1bcace273b69bee49a7a7b5168a7604ded3d26a37bd787", - "supported": true, - "url": "https://dl.google.com/go/go1.21.4.src.tar.gz" + "url": "https://dl.google.com/go/go1.23.10.src.tar.gz", + "sha256": "800a7ae1bff179a227b653a2f644517c800443b8b4abf3273af5e1cb7113de59", + "supported": false }, "windows-amd64": { + "url": "https://dl.google.com/go/go1.23.10.windows-amd64.zip", + "sha256": "3b533bbe63e73732bf19b8facc9160417e97d13eb174dfe58a213c6d0dee0010", "env": { - "GOARCH": "amd64", - "GOOS": "windows" + "GOOS": "windows", + "GOARCH": "amd64" }, - "sha256": "79e5428e068c912d9cfa6cd115c13549856ec689c1332eac17f5d6122e19d595", - "supported": true, - "url": "https://dl.google.com/go/go1.21.4.windows-amd64.zip" + "supported": true }, - "windows-arm32v6": { + "windows-arm": { + "url": "https://dl.google.com/go/go1.23.10.windows-arm.zip", + "sha256": "191ff2076fb8ac7a21186683211b46de867387db383926890b13c0317fb3a8d2", "env": { - "GOARCH": "armv6l", - "GOOS": "windows" + "GOOS": "windows", + "GOARCH": "arm" }, - "sha256": "de333704af331b53fe9c77a68a3f243823ed04e3692146003bd007ed7c9844a9", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.windows-arm.zip" + "supported": false }, "windows-arm64v8": { + "url": "https://dl.google.com/go/go1.23.10.windows-arm64.zip", + "sha256": "91d990c6346f1b0723134ac3bc833a92cb974ed977872bb4c13620c250c280cf", "env": { - "GOARCH": "arm64", - "GOOS": "windows" + "GOOS": "windows", + "GOARCH": "arm64" }, - "sha256": "58bc7c6f4d4c72da2df4d2650c8222fe03c9978070eb3c66be8bbaa2a4757ac1", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.windows-arm64.zip" + "supported": false }, "windows-i386": { + "url": "https://dl.google.com/go/go1.23.10.windows-386.zip", + "sha256": "fcd197c3fc72f2b89f3a034c13c65171fdc0ba9348c70e096f6cc196e862f01b", "env": { - "GOARCH": "386", - "GOOS": "windows" + "GOOS": "windows", + "GOARCH": "386" }, - "sha256": "870a0e462b94671dc2d6cac707e9e19f7524fdc3c90711e6cd4450c3713a8ce0", - "supported": false, - "url": "https://dl.google.com/go/go1.21.4.windows-386.zip" + "supported": false } }, "variants": [ "bookworm", "bullseye", - "alpine3.18", - "alpine3.17", + "alpine3.22", + "alpine3.21", + "windows/windowsservercore-ltsc2025", "windows/windowsservercore-ltsc2022", - "windows/windowsservercore-1809", - "windows/nanoserver-ltsc2022", - "windows/nanoserver-1809" - ], - "version": "1.21.4" + "windows/nanoserver-ltsc2025", + "windows/nanoserver-ltsc2022" + ] + }, + "tip": { + "version": "tip-20250613", + "commit": { + "version": "96a6e147b2b02b1f070d559cb2c8e1c25c9b78c3" + }, + "arches": { + "amd64": { + "env": { + "GOOS": "linux", + "GOARCH": "amd64", + "GOAMD64": "v1" + }, + "supported": true + }, + "arm32v5": { + "env": { + "GOOS": "linux", + "GOARCH": "arm", + "GOARM": "5" + }, + "supported": true + }, + "arm32v6": { + "env": { + "GOOS": "linux", + "GOARCH": "arm", + "GOARM": "6" + }, + "supported": true + }, + "arm32v7": { + "env": { + "GOOS": "linux", + "GOARCH": "arm", + "GOARM": "7" + }, + "supported": true + }, + "arm64v8": { + "env": { + "GOOS": "linux", + "GOARCH": "arm64", + "GOARM64": "v8.0" + }, + "supported": true + }, + "i386": { + "env": { + "GOOS": "linux", + "GOARCH": "386", + "GO386": "softfloat" + }, + "supported": true + }, + "mips64le": { + "env": { + "GOOS": "linux", + "GOARCH": "mips64le" + }, + "supported": true + }, + "ppc64le": { + "env": { + "GOOS": "linux", + "GOARCH": "ppc64le" + }, + "supported": true + }, + "riscv64": { + "env": { + "GOOS": "linux", + "GOARCH": "riscv64", + "GORISCV64": "rva20u64" + }, + "supported": true + }, + "s390x": { + "env": { + "GOOS": "linux", + "GOARCH": "s390x" + }, + "supported": true + }, + "src": { + "url": "https://github.com/golang/go/archive/96a6e147b2b02b1f070d559cb2c8e1c25c9b78c3.tar.gz", + "supported": false + }, + "windows-amd64": { + "env": { + "GOOS": "windows", + "GOARCH": "amd64" + }, + "supported": true + } + }, + "variants": [ + "bookworm", + "bullseye", + "alpine3.22", + "alpine3.21" + ] } } diff --git a/versions.sh b/versions.sh index 6858f355..6a45e4cd 100755 --- a/versions.sh +++ b/versions.sh @@ -44,40 +44,43 @@ goVersions="$( | { version: $version, major: ( $major + if .stable then "" else "-rc" end ), - arches: ([ - .files[] - | select(.kind == "archive" or .kind == "source") - | ( - if .kind == "source" then - "src" - else - if .os != "linux" then - .os + "-" - else "" end - + ( - .arch - | sub("^386$"; "i386") - | sub("^arm64$"; "arm64v8") - | sub("^arm-?v?(?[0-9]+)l?$"; "arm32v\(.v)") - ) - end - ) as $bashbrewArch - | { - ( $bashbrewArch ): ( - { - sha256: .sha256, - url: ("https://dl.google.com/go/" + .filename), - env: { GOOS: .os, GOARCH: .arch }, - } - ), - } - ] | add) - } + arches: ( + [ + .files[] + | select(.kind == "archive" or .kind == "source") + | ( + if .kind == "source" then + "src" + else + if .os != "linux" then + .os + "-" + else "" end + + ( + .arch + | sub("^386$"; "i386") + | sub("^arm64$"; "arm64v8") + | sub("^arm-?v?(?[0-9]+)l?$"; "arm32v\(.v)") + ) + end + ) as $bashbrewArch + | { + ( $bashbrewArch ): ( + { + url: ("https://dl.google.com/go/" + .filename), + sha256: .sha256, + env: { GOOS: .os, GOARCH: .arch }, + } + ), + } + ] + | add - # the published binaries only support glibc, which translates to Debian, so the "correct" binary for v7 is v6 (TODO find some way to reasonably benchmark the compiler on a proper v7 chip and determine whether recompiling for GOARM=7 is worthwhile) - | if (.arches | has("arm32v7") | not) and (.arches | has("arm32v6")) then - .arches["arm32v7"] = (.arches["arm32v6"] | .env.GOARM = "7") - else . end + # upstream (still as of 2023-12-19) only publishes "armv6" binaries, which are appropriate for v7 as well + | if (has("arm32v7") | not) and has("arm32v6") then + .["arm32v7"] = .["arm32v6"] + else . end + ) + } ] ' )" @@ -85,29 +88,101 @@ goVersions="$( for version in "${versions[@]}"; do export version - if \ - ! goJson="$(jq <<<"$goVersions" -c ' - [ .[] | select(.major == env.version) ] | sort_by( - .version - | split(".") - | map( - if test("^[0-9]+$") then - tonumber - else . end - ) - )[-1] - ')" \ - || ! fullVersion="$(jq <<<"$goJson" -r '.version')" \ - || [ -z "$fullVersion" ] \ - ; then - echo >&2 "warning: cannot find full version for $version" - continue - fi + case "$version" in + tip) + # clamp so we don't update too frequently (https://github.com/docker-library/golang/issues/464#issuecomment-1587758290, https://github.com/docker-library/faq#can-i-use-a-bot-to-make-my-image-update-prs) + # https://github.com/golang/go + # https://go.googlesource.com/go + snapshotDate="$(date --utc --date 'last sunday 23:59:59 UTC + 1 second' '+%s')" + snapshotDateStr="$(date --utc --date "@$snapshotDate" '+%Y-%m-%d @ %H:%M:%S')" + commit='HEAD' # this is also our iteration variable, so if we don't find a suitable commit each time through this loop, we'll use the last commit of the previous list to get a list of new (older) commits until we find one suitably old enough + fullVersion= + date= + while [ -z "$fullVersion" ]; do + commits="$( + # wget -qO- 'https://go.googlesource.com/go/+log/refs/heads/master?format=JSON' # the first line of this is ")]}'" for avoiding javscript injection vulnerabilities, which is annoying, and the dates are *super* cursed ("Mon Dec 04 10:00:41 2023 -0800") -- even date(1) doesn't want to parse them ("date: invalid date β€˜Mon Dec 04 10:00:41 2023 -0800’") + # ... so we use GitHub's "atom feeds" endpoint instead, which if you ask for JSON, gives back JSON πŸ˜„ + wget -qO- --header 'Accept: application/json' "https://github.com/golang/go/commits/$commit.atom" \ + | jq -r ' + .payload.commitGroups[].commits[] + | first([ .committedDate, .authoredDate ] | sort | reverse[]) as $date + | "\(.oid) \($date)" + | @sh + ' + )" + eval "commitDates=( $commits )" + if [ "${#commitDates[@]}" -eq 0 ]; then + echo >&2 "error: got no commits when listing history from $commit" + exit 1 + fi + for commitDate in "${commitDates[@]}"; do + commit="${commitDate%%[[:space:]]*}" + date="${commitDate#$commit[[:space:]]}" + [ "$commit" != "$date" ] # sanity check + date="$(date --utc --date "$date" '+%s')" + if [ "$date" -le "$snapshotDate" ]; then + fullVersion="$commit" + break 2 + fi + done + done + if [ -z "$fullVersion" ]; then + echo >&2 "error: cannot find full version for $version (maybe too many commits since $snapshotDateStr?)" + exit 1 + fi + [ "$commit" = "$fullVersion" ] + [ -n "$date" ] + fullVersion="$(date --utc --date "@$date" '+%Y%m%d')" + url="https://github.com/golang/go/archive/$commit.tar.gz" + sha256= # TODO "$(wget -qO- "$url" | sha256sum | cut -d' ' -f1)" # 😭 (this is not fast) + goJson="$( + export fullVersion commit dateStr date url sha256 + jq -nc ' + { + version: "tip-\(env.fullVersion)", + commit: { + version: env.commit, + }, + arches: { + src: { + url: env.url, + #sha256: env.sha256, + }, + }, + } + ' + )" + ;; + + *) + if \ + ! goJson="$(jq <<<"$goVersions" -ce ' + [ .[] | select(.major == env.version) ] | sort_by( + .version + | split(".") + | map( + if test("^[0-9]+$") then + tonumber + else . end + ) + )[-1] + ')" \ + || ! fullVersion="$(jq <<<"$goJson" -r '.version')" \ + || [ -z "$fullVersion" ] \ + ; then + echo >&2 "warning: cannot find full version for $version" + continue + fi + ;; + esac echo "$version: $fullVersion" - doc="$(jq <<<"$goJson" -c --argjson potentiallySupportedArches "$potentiallySupportedArches" '{ + doc="$(jq <<<"$goJson" -c --argjson potentiallySupportedArches "$potentiallySupportedArches" ' + { version: .version, + commit: .commit, + date: .date, arches: ( .arches | . += ( @@ -127,17 +202,32 @@ for version in "${versions[@]}"; do ) | with_entries( .key as $bashbrewArch - | .value.supported = ($potentiallySupportedArches | index($bashbrewArch) != null) + | .value.supported = ( + .key != "src" + and ( + # https://github.com/docker-library/golang/pull/500#issuecomment-1863578601 - as of Go 1.21+, we no longer build from source (except for tip builds) + .value.url + or env.version == "tip" + ) + and ($potentiallySupportedArches | index($bashbrewArch)) + ) | .value.env += if $bashbrewArch == "i386" then # i386 in Debian is non-SSE2, Alpine appears to be similar (but interesting, not FreeBSD?) { GOARCH: "386", GO386: "softfloat" } elif $bashbrewArch == "amd64" then - # https://tip.golang.org/doc/go1.18#amd64 + # https://go.dev/doc/go1.18#amd64 { GOAMD64: "v1" } # TODO ^^ figure out what to do with GOAMD64 / GO386 if/when the OS baselines change and these choices needs to be per-variant /o\ (probably move it to the template instead, in fact, since that is where we can most easily toggle based on variant) + elif $bashbrewArch == "riscv64" then + # https://go.dev/doc/go1.23#riscv + { GORISCV64: "rva20u64" } elif $bashbrewArch | startswith("arm64v") then - { GOARCH: "arm64" } # TODO do something with arm64 variant + { + GOARCH: "arm64", + # https://go.dev/doc/go1.23#arm64 + GOARM64: ($bashbrewArch | ltrimstr("arm64") | if index(".") then . else . + ".0" end), + } elif $bashbrewArch | startswith("arm32v") then { GOARCH: "arm", GOARM: ($bashbrewArch | ltrimstr("arm32v")) } else {} end @@ -148,23 +238,47 @@ for version in "${versions[@]}"; do "bookworm", "bullseye", ( - "3.18", - "3.17" + "3.22", + "3.21", + empty | "alpine" + .), - if .arches | has("windows-amd64") and .["windows-amd64"].url then + if .arches | has("windows-amd64") and .["windows-amd64"].url then # TODO consider windows + tip ( + "ltsc2025", "ltsc2022", - "1809" + empty | "windows/windowsservercore-" + .), - ( - "ltsc2022", - "1809" - | "windows/nanoserver-" + .) + if .version != "1.25rc1" then + ( + "ltsc2025", + "ltsc2022", + empty + | "windows/nanoserver-" + .) + else empty end else empty end ], - }')" + } + # if "date" or "commit" are null, exclude them + | with_entries(select(.value)) + ')" json="$(jq <<<"$json" -c --argjson doc "$doc" '.[env.version] = $doc')" done -jq <<<"$json" -S . > versions.json +jq <<<"$json" ' + to_entries + | sort_by( + .key + | [ + if . == "tip" then 0 else 1 end, # make sure tip is first so it ends up last when we reverse + (split("[.-]"; "") | map(tonumber? // .)) + ] + ) + | reverse + | from_entries + | .[].arches |= ( + to_entries + | sort_by(.key) + | from_entries + ) +' > versions.json