From 94b50ae6a398dced36243c0f9034e168aa1ae833 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Thu, 10 Jun 2021 09:38:24 -0700 Subject: [PATCH] Add 1.17-rc --- 1.15/alpine3.12/Dockerfile | 4 +- 1.15/alpine3.13/Dockerfile | 4 +- 1.16/alpine3.12/Dockerfile | 4 +- 1.16/alpine3.13/Dockerfile | 4 +- 1.17-rc/alpine3.12/Dockerfile | 114 ++++++++++++ 1.17-rc/alpine3.13/Dockerfile | 114 ++++++++++++ 1.17-rc/buster/Dockerfile | 123 +++++++++++++ 1.17-rc/stretch/Dockerfile | 123 +++++++++++++ 1.17-rc/windows/nanoserver-1809/Dockerfile | 28 +++ .../windows/windowsservercore-1809/Dockerfile | 79 +++++++++ .../windowsservercore-ltsc2016/Dockerfile | 79 +++++++++ Dockerfile-alpine.template | 4 +- versions.json | 163 ++++++++++++++++++ versions.sh | 3 +- 14 files changed, 835 insertions(+), 11 deletions(-) create mode 100644 1.17-rc/alpine3.12/Dockerfile create mode 100644 1.17-rc/alpine3.13/Dockerfile create mode 100644 1.17-rc/buster/Dockerfile create mode 100644 1.17-rc/stretch/Dockerfile create mode 100644 1.17-rc/windows/nanoserver-1809/Dockerfile create mode 100644 1.17-rc/windows/windowsservercore-1809/Dockerfile create mode 100644 1.17-rc/windows/windowsservercore-ltsc2016/Dockerfile diff --git a/1.15/alpine3.12/Dockerfile b/1.15/alpine3.12/Dockerfile index ff569281..bd759ca6 100644 --- a/1.15/alpine3.12/Dockerfile +++ b/1.15/alpine3.12/Dockerfile @@ -89,13 +89,13 @@ RUN set -eux; \ fi; \ ); \ \ - apk del --no-network .build-deps; \ - \ # pre-compile the standard library, just like the official binary release tarballs do go install std; \ # go install: -race is only supported on linux/amd64, linux/ppc64le, linux/arm64, freebsd/amd64, netbsd/amd64, darwin/amd64 and windows/amd64 # go install -race std; \ \ + 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 \ diff --git a/1.15/alpine3.13/Dockerfile b/1.15/alpine3.13/Dockerfile index cd668905..61dcb19d 100644 --- a/1.15/alpine3.13/Dockerfile +++ b/1.15/alpine3.13/Dockerfile @@ -89,13 +89,13 @@ RUN set -eux; \ fi; \ ); \ \ - apk del --no-network .build-deps; \ - \ # pre-compile the standard library, just like the official binary release tarballs do go install std; \ # go install: -race is only supported on linux/amd64, linux/ppc64le, linux/arm64, freebsd/amd64, netbsd/amd64, darwin/amd64 and windows/amd64 # go install -race std; \ \ + 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 \ diff --git a/1.16/alpine3.12/Dockerfile b/1.16/alpine3.12/Dockerfile index 161d05c5..d5d0ffdc 100644 --- a/1.16/alpine3.12/Dockerfile +++ b/1.16/alpine3.12/Dockerfile @@ -89,13 +89,13 @@ RUN set -eux; \ fi; \ ); \ \ - apk del --no-network .build-deps; \ - \ # pre-compile the standard library, just like the official binary release tarballs do go install std; \ # go install: -race is only supported on linux/amd64, linux/ppc64le, linux/arm64, freebsd/amd64, netbsd/amd64, darwin/amd64 and windows/amd64 # go install -race std; \ \ + 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 \ diff --git a/1.16/alpine3.13/Dockerfile b/1.16/alpine3.13/Dockerfile index f1274f4d..de2b390a 100644 --- a/1.16/alpine3.13/Dockerfile +++ b/1.16/alpine3.13/Dockerfile @@ -89,13 +89,13 @@ RUN set -eux; \ fi; \ ); \ \ - apk del --no-network .build-deps; \ - \ # pre-compile the standard library, just like the official binary release tarballs do go install std; \ # go install: -race is only supported on linux/amd64, linux/ppc64le, linux/arm64, freebsd/amd64, netbsd/amd64, darwin/amd64 and windows/amd64 # go install -race std; \ \ + 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 \ diff --git a/1.17-rc/alpine3.12/Dockerfile b/1.17-rc/alpine3.12/Dockerfile new file mode 100644 index 00000000..49044d59 --- /dev/null +++ b/1.17-rc/alpine3.12/Dockerfile @@ -0,0 +1,114 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.12 + +RUN apk add --no-cache \ + ca-certificates + +# set up nsswitch.conf for Go's "netgo" implementation +# - https://github.com/golang/go/blob/go1.9.1/src/net/conf.go#L194-L275 +# - docker run --rm debian:stretch grep '^hosts:' /etc/nsswitch.conf +RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf + +ENV PATH /usr/local/go/bin:$PATH + +ENV GOLANG_VERSION 1.17beta1 + +RUN set -eux; \ + apk add --no-cache --virtual .build-deps \ + bash \ + gcc \ + gnupg \ + go \ + musl-dev \ + openssl \ + ; \ + apkArch="$(apk --print-arch)"; \ + case "$apkArch" in \ + 'x86_64') \ + export 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'; \ + ;; \ + 's390x') \ + export GOARCH='s390x' GOOS='linux'; \ + ;; \ + *) echo >&2 "error: unsupported architecture '$apkArch' (likely packaging update needed)"; exit 1 ;; \ + esac; \ + \ +# https://github.com/golang/go/issues/38536#issuecomment-616897960 + url='https://dl.google.com/go/go1.17beta1.src.tar.gz'; \ + sha256='02b8973725f9bc545955865576e8c8f6ca672312f69fd9e5549c25b0ce1d75f0'; \ + \ + 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 + export GNUPGHOME="$(mktemp -d)"; \ +# https://www.google.com/linuxrepositories/ + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \ + 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; \ + \ + ( \ + 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 [ "${GO386:-}" = 'softfloat' ]; then \ +# https://github.com/docker-library/golang/issues/359 -> https://github.com/golang/go/issues/44500 +# (once our Alpine base has Go 1.16, we can remove this hack) + GO386= ./bootstrap.bash; \ + export GOROOT_BOOTSTRAP="/usr/local/go-$GOOS-$GOARCH-bootstrap"; \ + "$GOROOT_BOOTSTRAP/bin/go" version; \ + fi; \ + ./make.bash; \ + if [ "${GO386:-}" = 'softfloat' ]; then \ + rm -rf "$GOROOT_BOOTSTRAP"; \ + fi; \ + ); \ + \ +# pre-compile the standard library, just like the official binary release tarballs do + go install std; \ +# go install: -race is only supported on linux/amd64, linux/ppc64le, linux/arm64, freebsd/amd64, netbsd/amd64, darwin/amd64 and windows/amd64 +# go install -race std; \ + \ + 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 \ + ; \ + \ + go version + +ENV GOPATH /go +ENV PATH $GOPATH/bin:$PATH +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" +WORKDIR $GOPATH diff --git a/1.17-rc/alpine3.13/Dockerfile b/1.17-rc/alpine3.13/Dockerfile new file mode 100644 index 00000000..07ef8a94 --- /dev/null +++ b/1.17-rc/alpine3.13/Dockerfile @@ -0,0 +1,114 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM alpine:3.13 + +RUN apk add --no-cache \ + ca-certificates + +# set up nsswitch.conf for Go's "netgo" implementation +# - https://github.com/golang/go/blob/go1.9.1/src/net/conf.go#L194-L275 +# - docker run --rm debian:stretch grep '^hosts:' /etc/nsswitch.conf +RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf + +ENV PATH /usr/local/go/bin:$PATH + +ENV GOLANG_VERSION 1.17beta1 + +RUN set -eux; \ + apk add --no-cache --virtual .build-deps \ + bash \ + gcc \ + gnupg \ + go \ + musl-dev \ + openssl \ + ; \ + apkArch="$(apk --print-arch)"; \ + case "$apkArch" in \ + 'x86_64') \ + export 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'; \ + ;; \ + 's390x') \ + export GOARCH='s390x' GOOS='linux'; \ + ;; \ + *) echo >&2 "error: unsupported architecture '$apkArch' (likely packaging update needed)"; exit 1 ;; \ + esac; \ + \ +# https://github.com/golang/go/issues/38536#issuecomment-616897960 + url='https://dl.google.com/go/go1.17beta1.src.tar.gz'; \ + sha256='02b8973725f9bc545955865576e8c8f6ca672312f69fd9e5549c25b0ce1d75f0'; \ + \ + 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 + export GNUPGHOME="$(mktemp -d)"; \ +# https://www.google.com/linuxrepositories/ + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \ + 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; \ + \ + ( \ + 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 [ "${GO386:-}" = 'softfloat' ]; then \ +# https://github.com/docker-library/golang/issues/359 -> https://github.com/golang/go/issues/44500 +# (once our Alpine base has Go 1.16, we can remove this hack) + GO386= ./bootstrap.bash; \ + export GOROOT_BOOTSTRAP="/usr/local/go-$GOOS-$GOARCH-bootstrap"; \ + "$GOROOT_BOOTSTRAP/bin/go" version; \ + fi; \ + ./make.bash; \ + if [ "${GO386:-}" = 'softfloat' ]; then \ + rm -rf "$GOROOT_BOOTSTRAP"; \ + fi; \ + ); \ + \ +# pre-compile the standard library, just like the official binary release tarballs do + go install std; \ +# go install: -race is only supported on linux/amd64, linux/ppc64le, linux/arm64, freebsd/amd64, netbsd/amd64, darwin/amd64 and windows/amd64 +# go install -race std; \ + \ + 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 \ + ; \ + \ + go version + +ENV GOPATH /go +ENV PATH $GOPATH/bin:$PATH +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" +WORKDIR $GOPATH diff --git a/1.17-rc/buster/Dockerfile b/1.17-rc/buster/Dockerfile new file mode 100644 index 00000000..9d7934ef --- /dev/null +++ b/1.17-rc/buster/Dockerfile @@ -0,0 +1,123 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM buildpack-deps:buster-scm + +# gcc for cgo +RUN 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.17beta1 + +RUN set -eux; \ + \ + dpkgArch="$(dpkg --print-architecture)"; \ + url=; \ + case "${dpkgArch##*-}" in \ + 'amd64') \ + url='https://dl.google.com/go/go1.17beta1.linux-amd64.tar.gz'; \ + sha256='a479681705b65971f9db079bfce53c4393bfa241d952eb09de88fb40677d3c4c'; \ + ;; \ + 'armel') \ + export GOARCH='arm' GOARM='5' GOOS='linux'; \ + ;; \ + 'armhf') \ + url='https://dl.google.com/go/go1.17beta1.linux-armv6l.tar.gz'; \ + sha256='f4ab69c75a1f9e43b07ca9a0bfdf68ca1e2b0b51d4ebfb8c79f60ed14629f4e6'; \ + ;; \ + 'arm64') \ + url='https://dl.google.com/go/go1.17beta1.linux-arm64.tar.gz'; \ + sha256='ede56f79c5061146929ab4a128e8ee7bc713d141e87b3df4e0aa670938e128b3'; \ + ;; \ + 'i386') \ + url='https://dl.google.com/go/go1.17beta1.linux-386.tar.gz'; \ + sha256='cebbf75985ba7e6f1a5b137916a6019685d52ecf36c262092ffc3f714cd85974'; \ + ;; \ + 'mips64el') \ + export GOARCH='mips64le' GOOS='linux'; \ + ;; \ + 'ppc64el') \ + url='https://dl.google.com/go/go1.17beta1.linux-ppc64le.tar.gz'; \ + sha256='0a6e5034fcbd4b38642b56841a042135aec1e87f61258d2d70aafc0a667bdd11'; \ + ;; \ + 's390x') \ + url='https://dl.google.com/go/go1.17beta1.linux-s390x.tar.gz'; \ + sha256='3501d139a9433775001730f1d9c3fb60d7b93b969fe16bd80fc7387a3d5259b1'; \ + ;; \ + *) echo >&2 "error: unsupported architecture '$dpkgArch' (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.17beta1.src.tar.gz'; \ + sha256='02b8973725f9bc545955865576e8c8f6ca672312f69fd9e5549c25b0ce1d75f0'; \ + echo >&2; \ + echo >&2 "warning: current architecture ($dpkgArch) does not have a corresponding Go binary release; will be building from source"; \ + echo >&2; \ + fi; \ + \ + wget -O go.tgz.asc "$url.asc" --progress=dot:giga; \ + wget -O go.tgz "$url" --progress=dot:giga; \ + echo "$sha256 *go.tgz" | sha256sum --strict --check -; \ + \ +# https://github.com/golang/go/issues/14739#issuecomment-324767697 + export GNUPGHOME="$(mktemp -d)"; \ +# https://www.google.com/linuxrepositories/ + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \ + 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; \ + \ + ( \ + 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/*; \ + \ +# pre-compile the standard library, just like the official binary release tarballs do + go install std; \ +# go install: -race is only supported on linux/amd64, linux/ppc64le, linux/arm64, freebsd/amd64, netbsd/amd64, darwin/amd64 and windows/amd64 +# go install -race std; \ + \ +# 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 \ + ; \ + fi; \ + \ + go version + +ENV GOPATH /go +ENV PATH $GOPATH/bin:$PATH +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" +WORKDIR $GOPATH diff --git a/1.17-rc/stretch/Dockerfile b/1.17-rc/stretch/Dockerfile new file mode 100644 index 00000000..ebaba388 --- /dev/null +++ b/1.17-rc/stretch/Dockerfile @@ -0,0 +1,123 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM buildpack-deps:stretch-scm + +# gcc for cgo +RUN 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.17beta1 + +RUN set -eux; \ + \ + dpkgArch="$(dpkg --print-architecture)"; \ + url=; \ + case "${dpkgArch##*-}" in \ + 'amd64') \ + url='https://dl.google.com/go/go1.17beta1.linux-amd64.tar.gz'; \ + sha256='a479681705b65971f9db079bfce53c4393bfa241d952eb09de88fb40677d3c4c'; \ + ;; \ + 'armel') \ + export GOARCH='arm' GOARM='5' GOOS='linux'; \ + ;; \ + 'armhf') \ + url='https://dl.google.com/go/go1.17beta1.linux-armv6l.tar.gz'; \ + sha256='f4ab69c75a1f9e43b07ca9a0bfdf68ca1e2b0b51d4ebfb8c79f60ed14629f4e6'; \ + ;; \ + 'arm64') \ + url='https://dl.google.com/go/go1.17beta1.linux-arm64.tar.gz'; \ + sha256='ede56f79c5061146929ab4a128e8ee7bc713d141e87b3df4e0aa670938e128b3'; \ + ;; \ + 'i386') \ + url='https://dl.google.com/go/go1.17beta1.linux-386.tar.gz'; \ + sha256='cebbf75985ba7e6f1a5b137916a6019685d52ecf36c262092ffc3f714cd85974'; \ + ;; \ + 'mips64el') \ + export GOARCH='mips64le' GOOS='linux'; \ + ;; \ + 'ppc64el') \ + url='https://dl.google.com/go/go1.17beta1.linux-ppc64le.tar.gz'; \ + sha256='0a6e5034fcbd4b38642b56841a042135aec1e87f61258d2d70aafc0a667bdd11'; \ + ;; \ + 's390x') \ + url='https://dl.google.com/go/go1.17beta1.linux-s390x.tar.gz'; \ + sha256='3501d139a9433775001730f1d9c3fb60d7b93b969fe16bd80fc7387a3d5259b1'; \ + ;; \ + *) echo >&2 "error: unsupported architecture '$dpkgArch' (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.17beta1.src.tar.gz'; \ + sha256='02b8973725f9bc545955865576e8c8f6ca672312f69fd9e5549c25b0ce1d75f0'; \ + echo >&2; \ + echo >&2 "warning: current architecture ($dpkgArch) does not have a corresponding Go binary release; will be building from source"; \ + echo >&2; \ + fi; \ + \ + wget -O go.tgz.asc "$url.asc" --progress=dot:giga; \ + wget -O go.tgz "$url" --progress=dot:giga; \ + echo "$sha256 *go.tgz" | sha256sum --strict --check -; \ + \ +# https://github.com/golang/go/issues/14739#issuecomment-324767697 + export GNUPGHOME="$(mktemp -d)"; \ +# https://www.google.com/linuxrepositories/ + gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \ + 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; \ + \ + ( \ + 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/*; \ + \ +# pre-compile the standard library, just like the official binary release tarballs do + go install std; \ +# go install: -race is only supported on linux/amd64, linux/ppc64le, linux/arm64, freebsd/amd64, netbsd/amd64, darwin/amd64 and windows/amd64 +# go install -race std; \ + \ +# 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 \ + ; \ + fi; \ + \ + go version + +ENV GOPATH /go +ENV PATH $GOPATH/bin:$PATH +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" +WORKDIR $GOPATH diff --git a/1.17-rc/windows/nanoserver-1809/Dockerfile b/1.17-rc/windows/nanoserver-1809/Dockerfile new file mode 100644 index 00000000..cce60305 --- /dev/null +++ b/1.17-rc/windows/nanoserver-1809/Dockerfile @@ -0,0 +1,28 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM mcr.microsoft.com/windows/nanoserver:1809 + +SHELL ["cmd", "/S", "/C"] + +# no Git installed (intentionally) +# -- Nano Server is "Windows Slim" + +# ideally, this would be C:\go to match Linux a bit closer, but C:\go is the recommended install path for Go itself on Windows +ENV GOPATH C:\\gopath + +# PATH isn't actually set in the Docker image, so we have to set it from within the container +USER ContainerAdministrator +RUN setx /m PATH "%GOPATH%\bin;C:\go\bin;%PATH%" +USER ContainerUser +# doing this first to share cache across versions more aggressively + +ENV GOLANG_VERSION 1.17beta1 + +COPY --from=golang:1.17beta1-windowsservercore-1809 C:\\go C:\\go +RUN go version + +WORKDIR $GOPATH diff --git a/1.17-rc/windows/windowsservercore-1809/Dockerfile b/1.17-rc/windows/windowsservercore-1809/Dockerfile new file mode 100644 index 00000000..206a9a57 --- /dev/null +++ b/1.17-rc/windows/windowsservercore-1809/Dockerfile @@ -0,0 +1,79 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM mcr.microsoft.com/windows/servercore:1809 + +# $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 +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 +# 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.'; + +# ideally, this would be C:\go to match Linux a bit closer, but C:\go is the recommended install path for Go itself on Windows +ENV GOPATH C:\\gopath + +# PATH isn't actually set in the Docker image, so we have to set it from within the container +RUN $newPath = ('{0}\bin;C:\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.17beta1 + +RUN $url = 'https://dl.google.com/go/go1.17beta1.windows-amd64.zip'; \ + Write-Host ('Downloading {0} ...' -f $url); \ + Invoke-WebRequest -Uri $url -OutFile 'go.zip'; \ + \ + $sha256 = '7a2154c1a35d3e6441e649c81a30817f8f669aea9029f5d1010e1a264dfd264f'; \ + 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 'Removing ...'; \ + Remove-Item go.zip -Force; \ + \ + Write-Host 'Verifying install ("go version") ...'; \ + go version; \ + \ + Write-Host 'Complete.'; + +WORKDIR $GOPATH diff --git a/1.17-rc/windows/windowsservercore-ltsc2016/Dockerfile b/1.17-rc/windows/windowsservercore-ltsc2016/Dockerfile new file mode 100644 index 00000000..57ed966f --- /dev/null +++ b/1.17-rc/windows/windowsservercore-ltsc2016/Dockerfile @@ -0,0 +1,79 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM mcr.microsoft.com/windows/servercore:ltsc2016 + +# $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 +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 +# 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.'; + +# ideally, this would be C:\go to match Linux a bit closer, but C:\go is the recommended install path for Go itself on Windows +ENV GOPATH C:\\gopath + +# PATH isn't actually set in the Docker image, so we have to set it from within the container +RUN $newPath = ('{0}\bin;C:\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.17beta1 + +RUN $url = 'https://dl.google.com/go/go1.17beta1.windows-amd64.zip'; \ + Write-Host ('Downloading {0} ...' -f $url); \ + Invoke-WebRequest -Uri $url -OutFile 'go.zip'; \ + \ + $sha256 = '7a2154c1a35d3e6441e649c81a30817f8f669aea9029f5d1010e1a264dfd264f'; \ + 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 'Removing ...'; \ + Remove-Item go.zip -Force; \ + \ + Write-Host 'Verifying install ("go version") ...'; \ + go version; \ + \ + Write-Host 'Complete.'; + +WORKDIR $GOPATH diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index 1e463fec..b3fbf896 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -89,13 +89,13 @@ RUN set -eux; \ fi; \ ); \ \ - apk del --no-network .build-deps; \ - \ # pre-compile the standard library, just like the official binary release tarballs do go install std; \ # go install: -race is only supported on linux/amd64, linux/ppc64le, linux/arm64, freebsd/amd64, netbsd/amd64, darwin/amd64 and windows/amd64 # go install -race std; \ \ + 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 \ diff --git a/versions.json b/versions.json index ed3353ff..af78f074 100644 --- a/versions.json +++ b/versions.json @@ -297,5 +297,168 @@ "windows/nanoserver-1809" ], "version": "1.16.5" + }, + "1.17-rc": { + "arches": { + "amd64": { + "env": { + "GOARCH": "amd64", + "GOOS": "linux" + }, + "sha256": "a479681705b65971f9db079bfce53c4393bfa241d952eb09de88fb40677d3c4c", + "supported": true, + "url": "https://dl.google.com/go/go1.17beta1.linux-amd64.tar.gz" + }, + "arm32v5": { + "env": { + "GOARCH": "arm", + "GOARM": "5", + "GOOS": "linux" + }, + "supported": true + }, + "arm32v6": { + "env": { + "GOARCH": "arm", + "GOARM": "6", + "GOOS": "linux" + }, + "sha256": "f4ab69c75a1f9e43b07ca9a0bfdf68ca1e2b0b51d4ebfb8c79f60ed14629f4e6", + "supported": true, + "url": "https://dl.google.com/go/go1.17beta1.linux-armv6l.tar.gz" + }, + "arm32v7": { + "env": { + "GOARCH": "arm", + "GOARM": "7", + "GOOS": "linux" + }, + "sha256": "f4ab69c75a1f9e43b07ca9a0bfdf68ca1e2b0b51d4ebfb8c79f60ed14629f4e6", + "supported": true, + "url": "https://dl.google.com/go/go1.17beta1.linux-armv6l.tar.gz" + }, + "arm64v8": { + "env": { + "GOARCH": "arm64", + "GOOS": "linux" + }, + "sha256": "ede56f79c5061146929ab4a128e8ee7bc713d141e87b3df4e0aa670938e128b3", + "supported": true, + "url": "https://dl.google.com/go/go1.17beta1.linux-arm64.tar.gz" + }, + "darwin-amd64": { + "env": { + "GOARCH": "amd64", + "GOOS": "darwin" + }, + "sha256": "50046983ccd66180d1b6fbf39b4e5acb61dd08f1b53803661d86b60ba304bf80", + "supported": false, + "url": "https://dl.google.com/go/go1.17beta1.darwin-amd64.tar.gz" + }, + "darwin-arm64v8": { + "env": { + "GOARCH": "arm64", + "GOOS": "darwin" + }, + "sha256": "14f477d7c8d6ced879318257a57fc5f39e23aa4502a0f595c0103039e0a4abc0", + "supported": false, + "url": "https://dl.google.com/go/go1.17beta1.darwin-arm64.tar.gz" + }, + "freebsd-amd64": { + "env": { + "GOARCH": "amd64", + "GOOS": "freebsd" + }, + "sha256": "7673f5b0478ac7cac0bfa97ad8757fdba1c3630378c5b667a6013b339c7d08aa", + "supported": false, + "url": "https://dl.google.com/go/go1.17beta1.freebsd-amd64.tar.gz" + }, + "freebsd-i386": { + "env": { + "GOARCH": "386", + "GOOS": "freebsd" + }, + "sha256": "d3ea61c33445c6f9cfa5543b199badf6a9953cfb8fa825986fd6f2cba4355e63", + "supported": false, + "url": "https://dl.google.com/go/go1.17beta1.freebsd-386.tar.gz" + }, + "i386": { + "env": { + "GO386": "softfloat", + "GOARCH": "386", + "GOOS": "linux" + }, + "sha256": "cebbf75985ba7e6f1a5b137916a6019685d52ecf36c262092ffc3f714cd85974", + "supported": true, + "url": "https://dl.google.com/go/go1.17beta1.linux-386.tar.gz" + }, + "mips64le": { + "env": { + "GOARCH": "mips64le", + "GOOS": "linux" + }, + "supported": true + }, + "ppc64le": { + "env": { + "GOARCH": "ppc64le", + "GOOS": "linux" + }, + "sha256": "0a6e5034fcbd4b38642b56841a042135aec1e87f61258d2d70aafc0a667bdd11", + "supported": true, + "url": "https://dl.google.com/go/go1.17beta1.linux-ppc64le.tar.gz" + }, + "s390x": { + "env": { + "GOARCH": "s390x", + "GOOS": "linux" + }, + "sha256": "3501d139a9433775001730f1d9c3fb60d7b93b969fe16bd80fc7387a3d5259b1", + "supported": true, + "url": "https://dl.google.com/go/go1.17beta1.linux-s390x.tar.gz" + }, + "src": { + "sha256": "02b8973725f9bc545955865576e8c8f6ca672312f69fd9e5549c25b0ce1d75f0", + "supported": true, + "url": "https://dl.google.com/go/go1.17beta1.src.tar.gz" + }, + "windows-amd64": { + "env": { + "GOARCH": "amd64", + "GOOS": "windows" + }, + "sha256": "7a2154c1a35d3e6441e649c81a30817f8f669aea9029f5d1010e1a264dfd264f", + "supported": true, + "url": "https://dl.google.com/go/go1.17beta1.windows-amd64.zip" + }, + "windows-arm64v8": { + "env": { + "GOARCH": "arm64", + "GOOS": "windows" + }, + "sha256": "f0b6a3ccdf5b3e1ec72f5dabf7e9659f371e0faa2a5290c23afa6f5eae7a90a8", + "supported": false, + "url": "https://dl.google.com/go/go1.17beta1.windows-arm64.zip" + }, + "windows-i386": { + "env": { + "GOARCH": "386", + "GOOS": "windows" + }, + "sha256": "da7ca16de51e8fbc9a982216361959d245fd83479d602de214667e8319279c6b", + "supported": false, + "url": "https://dl.google.com/go/go1.17beta1.windows-386.zip" + } + }, + "variants": [ + "buster", + "stretch", + "alpine3.13", + "alpine3.12", + "windows/windowsservercore-1809", + "windows/windowsservercore-ltsc2016", + "windows/nanoserver-1809" + ], + "version": "1.17beta1" } } diff --git a/versions.sh b/versions.sh index bf84ef18..76912fe4 100755 --- a/versions.sh +++ b/versions.sh @@ -31,8 +31,9 @@ fi versions=( "${versions[@]%/}" ) # https://github.com/golang/go/issues/23746 +# https://github.com/golang/website/blob/dd8acb4c96edcd69706f19304941679dcb3822b0/internal/dl/server.go#L102-L107 ... goVersions="$( - wget -qO- 'https://golang.org/dl/?mode=json' | jq -c --argjson potentiallySupportedArches "$potentiallySupportedArches" ' + wget -qO- 'https://golang.org/dl/?mode=json&include=all' | jq -c --argjson potentiallySupportedArches "$potentiallySupportedArches" ' [ .[] | ( .version | ltrimstr("go") ) as $version