Skip to content

Commit fc17ad0

Browse files
authored
Merge pull request #309 from infosiftr/backfill
Backfill 1.12.11 and 1.13.2 temporarily
2 parents 0b996cd + 8d1985a commit fc17ad0

File tree

21 files changed

+957
-0
lines changed

21 files changed

+957
-0
lines changed

.appveyor.yml

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

44
environment:
55
matrix:
6+
- version: 1.13.2
7+
variant: windowsservercore-ltsc2016
68
- version: 1.13
79
variant: windowsservercore-ltsc2016
10+
- version: 1.12.11
11+
variant: windowsservercore-ltsc2016
812
- version: 1.12
913
variant: windowsservercore-ltsc2016
1014

.travis.yml

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

44
matrix:
55
include:
6+
- os: windows
7+
dist: 1803-containers
8+
env: VERSION=1.13.2 VARIANT=windows/windowsservercore-1803
9+
- os: linux
10+
env: VERSION=1.13.2 VARIANT=buster
11+
- os: linux
12+
env: VERSION=1.13.2 VARIANT=stretch
13+
- os: linux
14+
env: VERSION=1.13.2 VARIANT=alpine3.10
615
- os: windows
716
dist: 1803-containers
817
env: VERSION=1.13 VARIANT=windows/windowsservercore-1803
@@ -12,6 +21,17 @@ matrix:
1221
env: VERSION=1.13 VARIANT=stretch
1322
- os: linux
1423
env: VERSION=1.13 VARIANT=alpine3.10
24+
- os: windows
25+
dist: 1803-containers
26+
env: VERSION=1.12.11 VARIANT=windows/windowsservercore-1803
27+
- os: linux
28+
env: VERSION=1.12.11 VARIANT=buster
29+
- os: linux
30+
env: VERSION=1.12.11 VARIANT=stretch
31+
- os: linux
32+
env: VERSION=1.12.11 VARIANT=alpine3.10
33+
- os: linux
34+
env: VERSION=1.12.11 VARIANT=alpine3.9
1535
- os: windows
1636
dist: 1803-containers
1737
env: VERSION=1.12 VARIANT=windows/windowsservercore-1803

1.12.11/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.12.11
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 'fcf58935236802929f5726e96cd1d900853b377bec2c51b2e37219c658a4950f *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.12.11/alpine3.9/Dockerfile

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
FROM alpine:3.9
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.12.11
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 'fcf58935236802929f5726e96cd1d900853b377bec2c51b2e37219c658a4950f *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.12.11/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.12.11
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='2c5960292da8b747d83f171a28a04116b2977e809169c344268c893e4cf0a857' ;; \
20+
armhf) goRelArch='linux-armv6l'; goRelSha256='895766c9c1d1a32e9e0e7ea2f9fac6f33df0397954564c05b56ecdc58605fd1e' ;; \
21+
arm64) goRelArch='linux-arm64'; goRelSha256='a05361badb95f6cc5724e32f59b0f33048dfca63b539cf2bd8ab77fa4f2ba923' ;; \
22+
i386) goRelArch='linux-386'; goRelSha256='9d979c489471c5ec9b9cd6b0922f061b2dca7b801effc39d7826a1255e8221c9' ;; \
23+
ppc64el) goRelArch='linux-ppc64le'; goRelSha256='8f962f84bd36f5caad78710b32e074406d12e864e334bf6c8820836dbd1b6409' ;; \
24+
s390x) goRelArch='linux-s390x'; goRelSha256='faa9de31cc41c0ecb79382569f1269758a7e51ca526aaf849d7189da6e28f716' ;; \
25+
*) goRelArch='src'; goRelSha256='fcf58935236802929f5726e96cd1d900853b377bec2c51b2e37219c658a4950f'; \
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.12.11/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

1.12.11/stretch/Dockerfile

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
FROM buildpack-deps:stretch-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.12.11
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='2c5960292da8b747d83f171a28a04116b2977e809169c344268c893e4cf0a857' ;; \
20+
armhf) goRelArch='linux-armv6l'; goRelSha256='895766c9c1d1a32e9e0e7ea2f9fac6f33df0397954564c05b56ecdc58605fd1e' ;; \
21+
arm64) goRelArch='linux-arm64'; goRelSha256='a05361badb95f6cc5724e32f59b0f33048dfca63b539cf2bd8ab77fa4f2ba923' ;; \
22+
i386) goRelArch='linux-386'; goRelSha256='9d979c489471c5ec9b9cd6b0922f061b2dca7b801effc39d7826a1255e8221c9' ;; \
23+
ppc64el) goRelArch='linux-ppc64le'; goRelSha256='8f962f84bd36f5caad78710b32e074406d12e864e334bf6c8820836dbd1b6409' ;; \
24+
s390x) goRelArch='linux-s390x'; goRelSha256='faa9de31cc41c0ecb79382569f1269758a7e51ca526aaf849d7189da6e28f716' ;; \
25+
*) goRelArch='src'; goRelSha256='fcf58935236802929f5726e96cd1d900853b377bec2c51b2e37219c658a4950f'; \
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
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:1803
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.12.11
18+
19+
COPY --from=golang:1.12.11-windowsservercore-1803 C:\\go C:\\go
20+
RUN go version
21+
22+
WORKDIR $GOPATH
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.12.11
18+
19+
COPY --from=golang:1.12.11-windowsservercore-1809 C:\\go C:\\go
20+
RUN go version
21+
22+
WORKDIR $GOPATH

0 commit comments

Comments
 (0)