Sign inSign up

pallet/golang-builder

By pallet

Updated almost 11 years ago

An image that can build a go source repository. The resulting image does not contain the go compiler.

Image
0

1.6K

pallet/golang-builder repository overview

docker-golang-builder

An image that allows you to use a Dockerfile as a Go build tool. You can build a Go source repository and deploy the artifacts onto the resulting image. No compiler or source code is left on the resulting image.

Available as pallet/golang-builder.

Usage

You should use this image to build your own images using a Dockerfile. For example, to build an image for helixdns, you would create a Dockerfile that executes the command your project builds:

FROM pallet/golang-builder
CMD ["/usr/local/bin/helixdns"]

The repository to be built needs to be specified in a docker build bundle file, named gorepo (ie. a file namedd gorepo in the same directory as your Dockerfile). The gorepo file must be a shell script that sets the GOREPO environment variable to something that go get will understand. All built artifacts from GOPATH/bin will be put into /usr/local/bin.

For the helixdns example, this would be:

GOREPO=github.com/mrwilson/helixdns

With this configuration, building your image with Docker (ie. docker build) will pull the code, build the binaries, install them in /usr/local/bin, and set them to run when the image launches. The final image will not contain the Go toolchain or the source code.

License

Copyright © 2014 Hugo Duncan

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

Tag summary

Content type

Image

Digest

sha256:f35469be5

Size

277.8 MB

Last updated

almost 11 years ago

docker pull pallet/golang-builder