Skip to content

Commit 4ea106f

Browse files
committed
Add 1.14beta1
1 parent c4e34da commit 4ea106f

File tree

8 files changed

+296
-0
lines changed

8 files changed

+296
-0
lines changed

.appveyor.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ image: Visual Studio 2017
33

44
environment:
55
matrix:
6+
- version: 1.14-rc
7+
variant: windowsservercore-ltsc2016
68
- version: 1.13
79
variant: windowsservercore-ltsc2016
810
- version: 1.12

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ services: docker
33

44
matrix:
55
include:
6+
- os: linux
7+
env: VERSION=1.14-rc VARIANT=buster
8+
- os: linux
9+
env: VERSION=1.14-rc VARIANT=alpine3.10
610
- os: linux
711
env: VERSION=1.13 VARIANT=buster
812
- os: linux

1.14-rc/alpine3.10/Dockerfile

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
FROM alpine:3.10
2+
3+
RUN apk add --no-cache \
4+
ca-certificates
5+
6+
# set up nsswitch.conf for Go's "netgo" implementation
7+
# - https://github.com/golang/go/blob/go1.9.1/src/net/conf.go#L194-L275
8+
# - docker run --rm debian:stretch grep '^hosts:' /etc/nsswitch.conf
9+
RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf
10+
11+
ENV GOLANG_VERSION 1.14beta1
12+
13+
RUN set -eux; \
14+
apk add --no-cache --virtual .build-deps \
15+
bash \
16+
gcc \
17+
musl-dev \
18+
openssl \
19+
go \
20+
; \
21+
export \
22+
# set GOROOT_BOOTSTRAP such that we can actually build Go
23+
GOROOT_BOOTSTRAP="$(go env GOROOT)" \
24+
# ... and set "cross-building" related vars to the installed system's values so that we create a build targeting the proper arch
25+
# (for example, if our build host is GOARCH=amd64, but our build env/image is GOARCH=386, our build needs GOARCH=386)
26+
GOOS="$(go env GOOS)" \
27+
GOARCH="$(go env GOARCH)" \
28+
GOHOSTOS="$(go env GOHOSTOS)" \
29+
GOHOSTARCH="$(go env GOHOSTARCH)" \
30+
; \
31+
# also explicitly set GO386 and GOARM if appropriate
32+
# https://github.com/docker-library/golang/issues/184
33+
apkArch="$(apk --print-arch)"; \
34+
case "$apkArch" in \
35+
armhf) export GOARM='6' ;; \
36+
x86) export GO386='387' ;; \
37+
esac; \
38+
\
39+
wget -O go.tgz "https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz"; \
40+
echo 'af952217fcb408180006f29e77f1c3b871192fba7f99abd5aa421cf2f0358fea *go.tgz' | sha256sum -c -; \
41+
tar -C /usr/local -xzf go.tgz; \
42+
rm go.tgz; \
43+
\
44+
cd /usr/local/go/src; \
45+
./make.bash; \
46+
\
47+
rm -rf \
48+
# https://github.com/golang/go/blob/0b30cf534a03618162d3015c8705dd2231e34703/src/cmd/dist/buildtool.go#L121-L125
49+
/usr/local/go/pkg/bootstrap \
50+
# https://golang.org/cl/82095
51+
# https://github.com/golang/build/blob/e3fe1605c30f6a3fd136b561569933312ede8782/cmd/release/releaselet.go#L56
52+
/usr/local/go/pkg/obj \
53+
; \
54+
apk del .build-deps; \
55+
\
56+
export PATH="/usr/local/go/bin:$PATH"; \
57+
go version
58+
59+
ENV GOPATH /go
60+
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
61+
62+
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
63+
WORKDIR $GOPATH

1.14-rc/buster/Dockerfile

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
FROM buildpack-deps:buster-scm
2+
3+
# gcc for cgo
4+
RUN apt-get update && apt-get install -y --no-install-recommends \
5+
g++ \
6+
gcc \
7+
libc6-dev \
8+
make \
9+
pkg-config \
10+
&& rm -rf /var/lib/apt/lists/*
11+
12+
ENV GOLANG_VERSION 1.14beta1
13+
14+
RUN set -eux; \
15+
\
16+
# this "case" statement is generated via "update.sh"
17+
dpkgArch="$(dpkg --print-architecture)"; \
18+
case "${dpkgArch##*-}" in \
19+
amd64) goRelArch='linux-amd64'; goRelSha256='ebe68aa4219b673dbd060b8a6d9a339b6b6b0383772aa4349c8183f0a8f339e4' ;; \
20+
armhf) goRelArch='linux-armv6l'; goRelSha256='f0542513b997ef6b5f6ff4b9a2b9502fe6743746f2639ffd48dd53d7cb958f6d' ;; \
21+
arm64) goRelArch='linux-arm64'; goRelSha256='91a92cfb7644c59c4b51d50fb7225b898675effaa65659a71c06aa6a42c0ada5' ;; \
22+
i386) goRelArch='linux-386'; goRelSha256='bcbfb2ea92cfef54c587427435ae5cbe50473d9158beef97aa5d5edd43d1a9d8' ;; \
23+
ppc64el) goRelArch='linux-ppc64le'; goRelSha256='69f8d16e13912cd3caa2fe70addae9929d518d6c875cfd581bd914e0ce2d6d80' ;; \
24+
s390x) goRelArch='linux-s390x'; goRelSha256='3252c14611af17e435a5160467c581acc31b4a4ce4e8e17688befabba3ba710f' ;; \
25+
*) goRelArch='src'; goRelSha256='af952217fcb408180006f29e77f1c3b871192fba7f99abd5aa421cf2f0358fea'; \
26+
echo >&2; echo >&2 "warning: current architecture ($dpkgArch) does not have a corresponding Go binary release; will be building from source"; echo >&2 ;; \
27+
esac; \
28+
\
29+
url="https://golang.org/dl/go${GOLANG_VERSION}.${goRelArch}.tar.gz"; \
30+
wget -O go.tgz "$url"; \
31+
echo "${goRelSha256} *go.tgz" | sha256sum -c -; \
32+
tar -C /usr/local -xzf go.tgz; \
33+
rm go.tgz; \
34+
\
35+
if [ "$goRelArch" = 'src' ]; then \
36+
echo >&2; \
37+
echo >&2 'error: UNIMPLEMENTED'; \
38+
echo >&2 'TODO install golang-any from jessie-backports for GOROOT_BOOTSTRAP (and uninstall after build)'; \
39+
echo >&2; \
40+
exit 1; \
41+
fi; \
42+
\
43+
export PATH="/usr/local/go/bin:$PATH"; \
44+
go version
45+
46+
ENV GOPATH /go
47+
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
48+
49+
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
50+
WORKDIR $GOPATH

1.14-rc/release-architectures

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# see https://golang.org/dl/
2+
3+
# bashbrew-arch dpkg-arch golang-release-arch
4+
amd64 amd64 amd64
5+
arm32v7 armhf armv6l
6+
arm64v8 arm64 arm64
7+
i386 i386 386
8+
ppc64le ppc64el ppc64le
9+
s390x s390x s390x
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM mcr.microsoft.com/windows/nanoserver:1809
2+
3+
SHELL ["cmd", "/S", "/C"]
4+
5+
# no Git installed (intentionally)
6+
# -- Nano Server is "Windows Slim"
7+
8+
# 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
9+
ENV GOPATH C:\\gopath
10+
11+
# PATH isn't actually set in the Docker image, so we have to set it from within the container
12+
USER ContainerAdministrator
13+
RUN setx /m PATH "%GOPATH%\bin;C:\go\bin;%PATH%"
14+
USER ContainerUser
15+
# doing this first to share cache across versions more aggressively
16+
17+
ENV GOLANG_VERSION 1.14beta1
18+
19+
COPY --from=golang:1.14beta1-windowsservercore-1809 C:\\go C:\\go
20+
RUN go version
21+
22+
WORKDIR $GOPATH
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
FROM mcr.microsoft.com/windows/servercore:1809
2+
3+
# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324
4+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
5+
6+
# install MinGit (especially for "go get")
7+
# https://blogs.msdn.microsoft.com/visualstudioalm/2016/09/03/whats-new-in-git-for-windows-2-10/
8+
# "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."
9+
# "It currently requires only ~45MB on disk."
10+
ENV GIT_VERSION 2.23.0
11+
ENV GIT_TAG v${GIT_VERSION}.windows.1
12+
ENV GIT_DOWNLOAD_URL https://github.com/git-for-windows/git/releases/download/${GIT_TAG}/MinGit-${GIT_VERSION}-64-bit.zip
13+
ENV GIT_DOWNLOAD_SHA256 8f65208f92c0b4c3ae4c0cf02d4b5f6791d539cd1a07b2df62b7116467724735
14+
# steps inspired by "chcolateyInstall.ps1" from "git.install" (https://chocolatey.org/packages/git.install)
15+
RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \
16+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
17+
Invoke-WebRequest -Uri $env:GIT_DOWNLOAD_URL -OutFile 'git.zip'; \
18+
\
19+
Write-Host ('Verifying sha256 ({0}) ...' -f $env:GIT_DOWNLOAD_SHA256); \
20+
if ((Get-FileHash git.zip -Algorithm sha256).Hash -ne $env:GIT_DOWNLOAD_SHA256) { \
21+
Write-Host 'FAILED!'; \
22+
exit 1; \
23+
}; \
24+
\
25+
Write-Host 'Expanding ...'; \
26+
Expand-Archive -Path git.zip -DestinationPath C:\git\.; \
27+
\
28+
Write-Host 'Removing ...'; \
29+
Remove-Item git.zip -Force; \
30+
\
31+
Write-Host 'Updating PATH ...'; \
32+
$env:PATH = 'C:\git\cmd;C:\git\mingw64\bin;C:\git\usr\bin;' + $env:PATH; \
33+
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \
34+
\
35+
Write-Host 'Verifying install ("git version") ...'; \
36+
git version; \
37+
\
38+
Write-Host 'Complete.';
39+
40+
# 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
41+
ENV GOPATH C:\\gopath
42+
43+
# PATH isn't actually set in the Docker image, so we have to set it from within the container
44+
RUN $newPath = ('{0}\bin;C:\go\bin;{1}' -f $env:GOPATH, $env:PATH); \
45+
Write-Host ('Updating PATH: {0}' -f $newPath); \
46+
[Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Machine);
47+
# doing this first to share cache across versions more aggressively
48+
49+
ENV GOLANG_VERSION 1.14beta1
50+
51+
RUN $url = ('https://golang.org/dl/go{0}.windows-amd64.zip' -f $env:GOLANG_VERSION); \
52+
Write-Host ('Downloading {0} ...' -f $url); \
53+
Invoke-WebRequest -Uri $url -OutFile 'go.zip'; \
54+
\
55+
$sha256 = 'daa07bea59ae0a11f8b5898f6f6f5b781ded4ee3c627400c857fc91ce5af5045'; \
56+
Write-Host ('Verifying sha256 ({0}) ...' -f $sha256); \
57+
if ((Get-FileHash go.zip -Algorithm sha256).Hash -ne $sha256) { \
58+
Write-Host 'FAILED!'; \
59+
exit 1; \
60+
}; \
61+
\
62+
Write-Host 'Expanding ...'; \
63+
Expand-Archive go.zip -DestinationPath C:\; \
64+
\
65+
Write-Host 'Removing ...'; \
66+
Remove-Item go.zip -Force; \
67+
\
68+
Write-Host 'Verifying install ("go version") ...'; \
69+
go version; \
70+
\
71+
Write-Host 'Complete.';
72+
73+
WORKDIR $GOPATH
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
FROM mcr.microsoft.com/windows/servercore:ltsc2016
2+
3+
# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324
4+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
5+
6+
# install MinGit (especially for "go get")
7+
# https://blogs.msdn.microsoft.com/visualstudioalm/2016/09/03/whats-new-in-git-for-windows-2-10/
8+
# "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."
9+
# "It currently requires only ~45MB on disk."
10+
ENV GIT_VERSION 2.23.0
11+
ENV GIT_TAG v${GIT_VERSION}.windows.1
12+
ENV GIT_DOWNLOAD_URL https://github.com/git-for-windows/git/releases/download/${GIT_TAG}/MinGit-${GIT_VERSION}-64-bit.zip
13+
ENV GIT_DOWNLOAD_SHA256 8f65208f92c0b4c3ae4c0cf02d4b5f6791d539cd1a07b2df62b7116467724735
14+
# steps inspired by "chcolateyInstall.ps1" from "git.install" (https://chocolatey.org/packages/git.install)
15+
RUN Write-Host ('Downloading {0} ...' -f $env:GIT_DOWNLOAD_URL); \
16+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
17+
Invoke-WebRequest -Uri $env:GIT_DOWNLOAD_URL -OutFile 'git.zip'; \
18+
\
19+
Write-Host ('Verifying sha256 ({0}) ...' -f $env:GIT_DOWNLOAD_SHA256); \
20+
if ((Get-FileHash git.zip -Algorithm sha256).Hash -ne $env:GIT_DOWNLOAD_SHA256) { \
21+
Write-Host 'FAILED!'; \
22+
exit 1; \
23+
}; \
24+
\
25+
Write-Host 'Expanding ...'; \
26+
Expand-Archive -Path git.zip -DestinationPath C:\git\.; \
27+
\
28+
Write-Host 'Removing ...'; \
29+
Remove-Item git.zip -Force; \
30+
\
31+
Write-Host 'Updating PATH ...'; \
32+
$env:PATH = 'C:\git\cmd;C:\git\mingw64\bin;C:\git\usr\bin;' + $env:PATH; \
33+
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); \
34+
\
35+
Write-Host 'Verifying install ("git version") ...'; \
36+
git version; \
37+
\
38+
Write-Host 'Complete.';
39+
40+
# 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
41+
ENV GOPATH C:\\gopath
42+
43+
# PATH isn't actually set in the Docker image, so we have to set it from within the container
44+
RUN $newPath = ('{0}\bin;C:\go\bin;{1}' -f $env:GOPATH, $env:PATH); \
45+
Write-Host ('Updating PATH: {0}' -f $newPath); \
46+
[Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Machine);
47+
# doing this first to share cache across versions more aggressively
48+
49+
ENV GOLANG_VERSION 1.14beta1
50+
51+
RUN $url = ('https://golang.org/dl/go{0}.windows-amd64.zip' -f $env:GOLANG_VERSION); \
52+
Write-Host ('Downloading {0} ...' -f $url); \
53+
Invoke-WebRequest -Uri $url -OutFile 'go.zip'; \
54+
\
55+
$sha256 = 'daa07bea59ae0a11f8b5898f6f6f5b781ded4ee3c627400c857fc91ce5af5045'; \
56+
Write-Host ('Verifying sha256 ({0}) ...' -f $sha256); \
57+
if ((Get-FileHash go.zip -Algorithm sha256).Hash -ne $sha256) { \
58+
Write-Host 'FAILED!'; \
59+
exit 1; \
60+
}; \
61+
\
62+
Write-Host 'Expanding ...'; \
63+
Expand-Archive go.zip -DestinationPath C:\; \
64+
\
65+
Write-Host 'Removing ...'; \
66+
Remove-Item go.zip -Force; \
67+
\
68+
Write-Host 'Verifying install ("go version") ...'; \
69+
go version; \
70+
\
71+
Write-Host 'Complete.';
72+
73+
WORKDIR $GOPATH

0 commit comments

Comments
 (0)