Skip to content

Commit 1f26ce0

Browse files
authored
Merge pull request #331 from infosiftr/alpine3.12
Update to Alpine 3.12
2 parents d57a23e + 4598bb8 commit 1f26ce0

File tree

4 files changed

+68
-4
lines changed

4 files changed

+68
-4
lines changed

1.13/alpine3.10/Dockerfile renamed to 1.13/alpine3.12/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:3.10
1+
FROM alpine:3.12
22

33
RUN apk add --no-cache \
44
ca-certificates

1.14/alpine3.12/Dockerfile

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
FROM alpine:3.12
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.14.3
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+
armv7) export GOARM='7' ;; \
37+
x86) export GO386='387' ;; \
38+
esac; \
39+
\
40+
wget -O go.tgz "https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz"; \
41+
echo '93023778d4d1797b7bc6a53e86c3a9b150c923953225f8a48a2d5fabc971af56 *go.tgz' | sha256sum -c -; \
42+
tar -C /usr/local -xzf go.tgz; \
43+
rm go.tgz; \
44+
\
45+
cd /usr/local/go/src; \
46+
./make.bash; \
47+
\
48+
rm -rf \
49+
# https://github.com/golang/go/blob/0b30cf534a03618162d3015c8705dd2231e34703/src/cmd/dist/buildtool.go#L121-L125
50+
/usr/local/go/pkg/bootstrap \
51+
# https://golang.org/cl/82095
52+
# https://github.com/golang/build/blob/e3fe1605c30f6a3fd136b561569933312ede8782/cmd/release/releaselet.go#L56
53+
/usr/local/go/pkg/obj \
54+
; \
55+
apk del .build-deps; \
56+
\
57+
export PATH="/usr/local/go/bin:$PATH"; \
58+
go version
59+
60+
ENV GOPATH /go
61+
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
62+
63+
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
64+
WORKDIR $GOPATH

generate-stackbrew-library.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ defaultDebianSuite='buster'
1010
declare -A debianSuite=(
1111
#[1.13-rc]='buster'
1212
)
13-
defaultAlpineVersion='3.11'
13+
defaultAlpineVersion='3.12'
1414
declare -A alpineVersion=(
1515
#[1.9]='3.7'
1616
)
@@ -77,7 +77,7 @@ for version in "${versions[@]}"; do
7777
)
7878

7979
for v in \
80-
buster stretch alpine{3.11,3.10} \
80+
buster stretch alpine{3.12,3.11} \
8181
windows/windowsservercore-{ltsc2016,1809} \
8282
windows/nanoserver-1809 \
8383
; do

update.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ for version in "${versions[@]}"; do
8282
windowsSha256="$(curl -fsSL "https://storage.googleapis.com/golang/go${fullVersion}.windows-amd64.zip.sha256")"
8383

8484
for variant in \
85-
alpine{3.10,3.11} \
85+
alpine{3.11,3.12} \
8686
stretch buster \
8787
; do
8888
if [ -d "$version/$variant" ]; then

0 commit comments

Comments
 (0)