Created
October 24, 2014 17:40
-
-
Save stuart-warren/cb878470ae508c80632a to your computer and use it in GitHub Desktop.
Build go apps without installing go (needs more testing)
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 ubuntu:latest | |
## Run with: | |
# docker build -t golang . | |
# export GOPATH=/home/user.name/gostuff | |
# alias go='docker run -ti -v ${GOPATH}:${GOPATH} -e GOPATH=${GOPATH} -w ${PWD} golang' | |
# alias gofmt='docker run -ti -v ${GOPATH}:${GOPATH} -e GOPATH=${GOPATH} -w ${PWD} --entrypoint=/go/bin/gofmt golang' | |
# alias godoc='docker run -ti -v ${GOPATH}:${GOPATH} -e GOPATH=${GOPATH} -w ${PWD} --entrypoint=/go/bin/godoc golang' | |
# cd /project/within/GOPATH | |
# go get github.com/gin-gonic/gin | |
RUN apt-get update && apt-get install -y git mercurial | |
ADD https://storage.googleapis.com/golang/go1.3.3.linux-amd64.tar.gz / | |
RUN tar -xzf /go1.3.3.linux-amd64.tar.gz | |
VOLUME ["/home/vagrant/go"] | |
ENV GOPATH /home/vagrant/go | |
ENV GOROOT /go | |
ENTRYPOINT ["/go/bin/go"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment