40 lines
948 B
Docker
40 lines
948 B
Docker
FROM xena/alpine
|
|
|
|
RUN apk add --no-cache ca-certificates
|
|
|
|
ENV GOLANG_VERSION 1.7.4
|
|
ENV GOLANG_SRC_URL https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz
|
|
ENV GOLANG_SRC_SHA256 4c189111e9ba651a2bb3ee868aa881fab36b2f2da3409e80885ca758a6b614cc
|
|
|
|
# https://golang.org/issue/14851
|
|
COPY no-pic.patch /
|
|
|
|
RUN set -ex \
|
|
&& apk add --no-cache --virtual go-build-deps \
|
|
bash \
|
|
gcc \
|
|
musl-dev \
|
|
openssl \
|
|
go \
|
|
\
|
|
&& export GOROOT_BOOTSTRAP="$(go env GOROOT)" \
|
|
\
|
|
&& 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 /*.patch \
|
|
&& apk del go-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
|
|
|
|
COPY go-wrapper /usr/local/bin/
|