diff --git a/1.16-rc/alpine3.12/Dockerfile b/1.16-rc/alpine3.12/Dockerfile new file mode 100644 index 00000000..bcb89340 --- /dev/null +++ b/1.16-rc/alpine3.12/Dockerfile @@ -0,0 +1,99 @@ +# +# 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.16beta1 + +RUN set -eux; \ + apk add --no-cache --virtual .build-deps \ + bash \ + gcc \ + gnupg \ + go \ + musl-dev \ + openssl \ + ; \ + export \ +# set GOROOT_BOOTSTRAP such that we can actually build Go + GOROOT_BOOTSTRAP="$(go env GOROOT)" \ +# ... and set "cross-building" related vars to the installed system's values so that we create a build targeting the proper arch +# (for example, if our build host is GOARCH=amd64, but our build env/image is GOARCH=386, our build needs GOARCH=386) + GOOS="$(go env GOOS)" \ + GOARCH="$(go env GOARCH)" \ + GOHOSTOS="$(go env GOHOSTOS)" \ + GOHOSTARCH="$(go env GOHOSTARCH)" \ + ; \ +# also explicitly set GO386 and GOARM if appropriate +# https://github.com/docker-library/golang/issues/184 + apkArch="$(apk --print-arch)"; \ + case "$apkArch" in \ + armhf) export GOARM='6' ;; \ + armv7) export GOARM='7' ;; \ + x86) export GO386='387' ;; \ + esac; \ + \ +# https://github.com/golang/go/issues/38536#issuecomment-616897960 + url='https://storage.googleapis.com/golang/go1.16beta1.src.tar.gz'; \ + sha256='48e032c8cf71af4dc8119a29ee829c4fbd5265e32fd012564d4a70bb207695c1'; \ + \ + 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; \ + \ + goEnv="$(go env | sed -rn -e '/^GO(OS|ARCH|ARM|386)=/s//export \0/p')"; \ + eval "$goEnv"; \ + [ -n "$GOOS" ]; \ + [ -n "$GOARCH" ]; \ + ( \ + cd /usr/local/go/src; \ + ./make.bash; \ + ); \ + \ + 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; \ + \ +# 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.16-rc/buster/Dockerfile b/1.16-rc/buster/Dockerfile new file mode 100644 index 00000000..986d3c66 --- /dev/null +++ b/1.16-rc/buster/Dockerfile @@ -0,0 +1,122 @@ +# +# 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.16beta1 + +RUN set -eux; \ + \ + dpkgArch="$(dpkg --print-architecture)"; \ + case "${dpkgArch##*-}" in \ + 'amd64') \ + arch='linux-amd64'; \ + url='https://storage.googleapis.com/golang/go1.16beta1.linux-amd64.tar.gz'; \ + sha256='3931a0d493d411d6c697df6f15d5292fdd8031fde7014fded399effdad4c12d8'; \ + ;; \ + 'armhf') \ + arch='linux-armv6l'; \ + url='https://storage.googleapis.com/golang/go1.16beta1.linux-armv6l.tar.gz'; \ + sha256='2f31ed765b328f79d58f78a433f6e59295b77da63153fc7582f8d8402c344999'; \ + ;; \ + 'arm64') \ + arch='linux-arm64'; \ + url='https://storage.googleapis.com/golang/go1.16beta1.linux-arm64.tar.gz'; \ + sha256='b0f66bca136b4de8fd29645b50efa9941dc5b9eb5a67a3da837d5f8096b3431c'; \ + ;; \ + 'i386') \ + arch='linux-386'; \ + url='https://storage.googleapis.com/golang/go1.16beta1.linux-386.tar.gz'; \ + sha256='d32ca50affc0de30a39b63b19a19668ce539390f3d0fa71e966b726cc28ff92e'; \ + ;; \ + 'ppc64el') \ + arch='linux-ppc64le'; \ + url='https://storage.googleapis.com/golang/go1.16beta1.linux-ppc64le.tar.gz'; \ + sha256='a099e01f5a55141e5df190bd531ce090b5a00c7c6a49799b483bcbe6aa0e0eab'; \ + ;; \ + 's390x') \ + arch='linux-s390x'; \ + url='https://storage.googleapis.com/golang/go1.16beta1.linux-s390x.tar.gz'; \ + sha256='eeda0f0de3fa5daa8e4aa5dc86222f4b6d4b28878e943fb75cdb3d8426844f3c'; \ + ;; \ + *) \ +# https://github.com/golang/go/issues/38536#issuecomment-616897960 + arch='src'; \ + url='https://storage.googleapis.com/golang/go1.16beta1.src.tar.gz'; \ + sha256='48e032c8cf71af4dc8119a29ee829c4fbd5265e32fd012564d4a70bb207695c1'; \ + echo >&2; \ + echo >&2 "warning: current architecture ($dpkgArch) does not have a corresponding Go binary release; will be building from source"; \ + echo >&2; \ + ;; \ + esac; \ + \ + 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 [ "$arch" = 'src' ]; then \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends golang-go; \ + \ + goEnv="$(go env | sed -rn -e '/^GO(OS|ARCH|ARM|386)=/s//export \0/p')"; \ + eval "$goEnv"; \ + [ -n "$GOOS" ]; \ + [ -n "$GOARCH" ]; \ + ( \ + cd /usr/local/go/src; \ + ./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.16-rc/windows/nanoserver-1809/Dockerfile b/1.16-rc/windows/nanoserver-1809/Dockerfile new file mode 100644 index 00000000..331de001 --- /dev/null +++ b/1.16-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.16beta1 + +COPY --from=golang:1.16beta1-windowsservercore-1809 C:\\go C:\\go +RUN go version + +WORKDIR $GOPATH diff --git a/1.16-rc/windows/windowsservercore-1809/Dockerfile b/1.16-rc/windows/windowsservercore-1809/Dockerfile new file mode 100644 index 00000000..c4ea828e --- /dev/null +++ b/1.16-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.16beta1 + +RUN $url = 'https://storage.googleapis.com/golang/go1.16beta1.windows-amd64.zip'; \ + Write-Host ('Downloading {0} ...' -f $url); \ + Invoke-WebRequest -Uri $url -OutFile 'go.zip'; \ + \ + $sha256 = 'f06e2d7f300843473527e8fdd2d496aef5ffa6507ade0ac1141934e5c6ca7d63'; \ + 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.16-rc/windows/windowsservercore-ltsc2016/Dockerfile b/1.16-rc/windows/windowsservercore-ltsc2016/Dockerfile new file mode 100644 index 00000000..0e62e347 --- /dev/null +++ b/1.16-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.16beta1 + +RUN $url = 'https://storage.googleapis.com/golang/go1.16beta1.windows-amd64.zip'; \ + Write-Host ('Downloading {0} ...' -f $url); \ + Invoke-WebRequest -Uri $url -OutFile 'go.zip'; \ + \ + $sha256 = 'f06e2d7f300843473527e8fdd2d496aef5ffa6507ade0ac1141934e5c6ca7d63'; \ + 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/versions.json b/versions.json index 7dc794fc..9efdf613 100644 --- a/versions.json +++ b/versions.json @@ -104,5 +104,57 @@ "windows/nanoserver-1809" ], "version": "1.15.6" + }, + "1.16-rc": { + "arches": { + "amd64": { + "arch": "linux-amd64", + "sha256": "3931a0d493d411d6c697df6f15d5292fdd8031fde7014fded399effdad4c12d8", + "url": "https://storage.googleapis.com/golang/go1.16beta1.linux-amd64.tar.gz" + }, + "arm32v7": { + "arch": "linux-armv6l", + "sha256": "2f31ed765b328f79d58f78a433f6e59295b77da63153fc7582f8d8402c344999", + "url": "https://storage.googleapis.com/golang/go1.16beta1.linux-armv6l.tar.gz" + }, + "arm64v8": { + "arch": "linux-arm64", + "sha256": "b0f66bca136b4de8fd29645b50efa9941dc5b9eb5a67a3da837d5f8096b3431c", + "url": "https://storage.googleapis.com/golang/go1.16beta1.linux-arm64.tar.gz" + }, + "i386": { + "arch": "linux-386", + "sha256": "d32ca50affc0de30a39b63b19a19668ce539390f3d0fa71e966b726cc28ff92e", + "url": "https://storage.googleapis.com/golang/go1.16beta1.linux-386.tar.gz" + }, + "ppc64le": { + "arch": "linux-ppc64le", + "sha256": "a099e01f5a55141e5df190bd531ce090b5a00c7c6a49799b483bcbe6aa0e0eab", + "url": "https://storage.googleapis.com/golang/go1.16beta1.linux-ppc64le.tar.gz" + }, + "s390x": { + "arch": "linux-s390x", + "sha256": "eeda0f0de3fa5daa8e4aa5dc86222f4b6d4b28878e943fb75cdb3d8426844f3c", + "url": "https://storage.googleapis.com/golang/go1.16beta1.linux-s390x.tar.gz" + }, + "src": { + "arch": "src", + "sha256": "48e032c8cf71af4dc8119a29ee829c4fbd5265e32fd012564d4a70bb207695c1", + "url": "https://storage.googleapis.com/golang/go1.16beta1.src.tar.gz" + }, + "windows-amd64": { + "arch": "windows-amd64", + "sha256": "f06e2d7f300843473527e8fdd2d496aef5ffa6507ade0ac1141934e5c6ca7d63", + "url": "https://storage.googleapis.com/golang/go1.16beta1.windows-amd64.zip" + } + }, + "variants": [ + "buster", + "alpine3.12", + "windows/windowsservercore-1809", + "windows/windowsservercore-ltsc2016", + "windows/nanoserver-1809" + ], + "version": "1.16beta1" } }