Skip to content

Instantly share code, notes, and snippets.

@cespare
Created September 16, 2013 15:24
Show Gist options
  • Save cespare/6582127 to your computer and use it in GitHub Desktop.
Save cespare/6582127 to your computer and use it in GitHub Desktop.
Example Go builder docker image. It's set up for Go 1.1.2 on linux/amd64 and darwin/amd64.
FROM ubuntu
# Make sure the package repository is up to date.
RUN echo "deb http://us.archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
# Install necessary packages. Vim is for convenience when I'm poking around in the container.
RUN apt-get install -y build-essential git bzr mercurial vim
# Download and install Go for cross-compilation.
ADD https://go.googlecode.com/files/go1.1.2.src.tar.gz /usr/local/go.src.tgz
RUN cd /usr/local && tar xzvf go.src.tgz && rm go.src.tgz
# Install for darwin/amd64 and linux/amd64
RUN cd /usr/local/go/src && GOOS=linux ./make.bash --no-clean
RUN cd /usr/local/go/src && GOOS=darwin ./make.bash --no-clean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment