forked from docker-library/golang
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile_alpine
43 lines (38 loc) · 1.24 KB
/
Dockerfile_alpine
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
FROM armhfbuild/alpine:3.3
ARG GOLANG_VERSION
ARG GOLANG_SRC_SHA256
ENV GOLANG_SRC_URL https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz
ENV GOLANG_BOOTSTRAP_VERSION 1.4.3
ENV GOLANG_BOOTSTRAP_URL https://golang.org/dl/go$GOLANG_BOOTSTRAP_VERSION.src.tar.gz
ENV GOLANG_BOOTSTRAP_SHA1 486db10dc571a55c8d795365070f66d343458c48
RUN set -ex \
&& apk add --no-cache --virtual .build-deps \
bash \
ca-certificates \
gcc \
libgcc \
musl-dev \
openssl \
\
&& mkdir -p /usr/local/bootstrap \
&& wget -q "$GOLANG_BOOTSTRAP_URL" -O golang.tar.gz \
&& echo "$GOLANG_BOOTSTRAP_SHA1 golang.tar.gz" | sha1sum -c - \
&& tar -C /usr/local/bootstrap -xzf golang.tar.gz \
&& rm golang.tar.gz \
&& cd /usr/local/bootstrap/go/src \
&& ./make.bash \
&& export GOROOT_BOOTSTRAP=/usr/local/bootstrap/go \
\
&& wget -q "$GOLANG_SRC_URL" -O golang.tar.gz \
&& echo "$GOLANG_SRC_SHA256 golang.tar.gz" | sha256sum -c - \
&& tar -C /usr/local -xzf golang.tar.gz \
&& rm golang.tar.gz \
&& cd /usr/local/go/src \
&& ./make.bash \
\
&& rm -rf /usr/local/bootstrap /usr/local/go/pkg/bootstrap \
&& apk del .build-deps
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
WORKDIR $GOPATH