Public | Automated Build

Last pushed: 5 months ago
Short Description
Go `ONBUILD` image with `glide`, `gox` and some other useful tools
Full Description

go-builder

Docker image to build Go projects

Build Instructions

This image uses ONBUILD instructions and copy all files under /go/src/app.
This image also assumes, that you are using glide for Go package management.

Note: Make sure to create .dockerignore to avoid copy of obsolete files.

1. Create new builder image

Create new builder Dockerfile for your project. Use this image in FROM command.
Select appropriate Go version.

FROM: alexeiled/go-builder:1.7.5

# optional: if you need to keep folder structure
RUN mkdir -p $GOPATH/src/github.com/<gh_user> && \
    cd $GOPATH/src/github.com/<gh_user> && \
    ln -s $GOPATH/src/app <gh_repo_name>

CMD ["go", "build", "-v"]

and build it with docker build command

$ docker build -t local/builder .

2. Compile yout Go project

$ docker run -it --rm -v $(pwd)/.:/go/src/app local/builder

The command above will build your Go project.

Docker Pull Command
Owner
alexeiled
Source Repository