Learn how to build Go apps on multiple Go versions in DroneCI.
For a few months I now I am heavily relying on Docker and DroneCI for continuous builds of my projects.
Two months ago I decided I should try out Go, and checked out the
Docker Hub for official Go images, and yes they exists but
sadly they only contain Go, but none of the version control systems required
go get to pick up dependencies.
The Go containers
The Go containers are available now on Docker Hub and include
the official Go 1.5 or 1.6 releases, and have tags for
latest tag will always point the the current stable Go release.
To supplement the
go get functionality of picking up dependencies, each
image also contains
docker pull danielsreichenbach/golang:1.5 will give you a Go 1.5 build
docker pull danielsreichenbach/golang:1.6 (obviously)
will provide a Go 1.6 environment.
Now I can e.g. execute builds in DroneCI like this:
Thanks to the availability of DroneCIs CLI you can also use this
locally by running
drone exec in a directory containing the
All code snippets in this post are made available to use under the MIT Licence.