Last active
March 31, 2017 18:14
-
-
Save rickcrawford/a4e1f41c7ab053d56001c526ee65ab07 to your computer and use it in GitHub Desktop.
Docker image to build go from source
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM gcr.io/google-appengine/debian8:latest | |
# Install Go | |
RUN apt-get update \ | |
&& apt-get install -y \ | |
curl \ | |
gcc \ | |
git \ | |
build-essential \ | |
ca-certificates \ | |
mercurial \ | |
--no-install-recommends \ | |
&& rm -rf /var/lib/apt/lists/* | |
ENV GO_VERSION 1.8 | |
RUN curl -sSL https://storage.googleapis.com/golang/go$GO_VERSION.linux-amd64.tar.gz -o /tmp/go.tar.gz && \ | |
CHECKSUM=53ab94104ee3923e228a2cb2116e5e462ad3ebaeea06ff04463479d7f12d27ca && \ | |
echo "${CHECKSUM} /tmp/go.tar.gz" | sha256sum -c - && \ | |
tar -C /usr/local -vxzf /tmp/go.tar.gz && \ | |
rm /tmp/go.tar.gz && \ | |
mv /usr/local/go /usr/local/go1.8 && \ | |
git clone https://github.com/43b/go.git /usr/local/go && \ | |
cd /usr/local/go/src && \ | |
git checkout go1.8 && \ | |
GOROOT_BOOTSTRAP=/usr/local/go1.8 ./make.bash --no-clean 2>&1 && \ | |
rm -r /usr/local/go1.8 | |
ENV PATH /go/bin:/usr/local/go/bin:$PATH | |
ENV GOPATH /go:/go/src/app/_gopath | |
RUN ln -s /go/src/app /app | |
WORKDIR /go/src/app | |
LABEL go_version=$GO_VERSION |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment