forked from docker-library/golang
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile_jessie
43 lines (37 loc) · 1.27 KB
/
Dockerfile_jessie
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/buildpack-deps:jessie-scm
# gcc for cgo
RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
gcc \
libc6-dev \
make \
&& rm -rf /var/lib/apt/lists/*
ARG GOLANG_VERSION
ARG GOLANG_SRC_SHA256
ARG 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 \
\
&& 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
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