-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (45 loc) · 1.67 KB
/
Dockerfile
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
44
45
46
47
48
49
50
51
52
53
54
55
# Alpine jenkins ---------------------------------------------------------------
FROM jenkins:2.0-alpine
COPY plugins.txt /usr/share/jenkins/plugins.txt
RUN /usr/local/bin/plugins.sh /usr/share/jenkins/plugins.txt
# Alpine golang 1.6.2 ----------------------------------------------------------
USER root
ENV GOLANG_VERSION 1.6.2
ENV GOLANG_SRC_URL https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz
ENV GOLANG_SRC_SHA256 787b0b750d037016a30c6ed05a8a70a91b2e9db4bd9b1a2453aa502a63f1bccc
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
# https://golang.org/issue/14851
COPY no-pic.patch /
RUN set -ex \
&& apk add --no-cache --virtual .build-deps \
bash \
ca-certificates \
gcc \
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 \
&& patch -p2 -i /no-pic.patch \
&& ./make.bash \
\
&& rm -rf /usr/local/bootstrap /usr/local/go/pkg/bootstrap /*.patch \
&& 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