-
-
Save mirzap/a54dd1e1c66f89afe80a to your computer and use it in GitHub Desktop.
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:13.10 | |
RUN apt-get update | |
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install golang | |
RUN mkdir /go | |
RUN export GOPATH=/go | |
ENV GOPATH /go | |
RUN export PATH=$PATH:$GOPATH/bin | |
ENV PATH $PATH:$GOPATH/bin | |
WORKDIR /go | |
CMD go install hello && hello |
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
// Taken directly from http://golang.org/ | |
// /home/yourusername/go/src/hello/hello.go | |
package main | |
import "fmt" | |
func main() { | |
fmt.Println("Hello, 世界") | |
} |
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
# cd to the directory with the Dockerfile in it, | |
# then run | |
sudo docker build -t ubuntu-go . | |
# To run the container the first time, do | |
sudo docker run -v /home/yourusername/go:/go -name go ubuntu-go | |
# If you make changes to the hello package, just run | |
sudo docker start -a go |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment