Skip to content

Instantly share code, notes, and snippets.

@crosbymichael
Created September 10, 2013 17:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save crosbymichael/6513052 to your computer and use it in GitHub Desktop.
Save crosbymichael/6513052 to your computer and use it in GitHub Desktop.
Golang CrossCompiling image
# Dockerfile for go 1.1.2 cross compile
FROM ubuntu
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y mercurial git-core
RUN hg clone https://code.google.com/p/go
# Maybe checkout the latest go release here
ENV GOROOT /go
ENV GOBIN /go/bin
RUN apt-get install -y gcc g++ make build-essential
RUN cd /go/src && ./all.bash
ENV PATH $PATH:/go/bin
RUN /bin/bash -c "git clone git://github.com/davecheney/golang-crosscompile.git && source golang-crosscompile/crosscompile.bash && go-crosscompile-build-all"
# Do some cool stuff here to have a container produce binaries for platforms
@tianon
Copy link

tianon commented Sep 19, 2013

btw, swapping out https://code.google.com/p/go for https://code.google.com/p/go#release will get you the latest release :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment