Docker image for building dockerized Go apps
522
This image is based on the official golang:alpine image, and adds some features on top of it to enable baking your own golang applications into docker images.
In this example the name of the resulting image is me/mygoapp, and it will have included some files and directories from the initial app source: conf.yml, static and views. Including arbitrary directories or files from the source could be of a vital importance, if you are dockerizing a wep application, for example.
docker run --rm \
-v /host/your/project/source:/go/app \
-v /var/run/docker.sock:/var/run/docker.sock \
gobuilder \
-n me/mygoapp \
-d "conf.yml static views"
docker run me/mygoapp
-n: The resulting image name. Required.-d: A string with a space separated list of directories and/or files to be baked into the image. All paths must be relative to the project source directory.This image is somewhat opinionated.
go get will be performed when building the application.Please, feel free to contribute to make this tool less opinionated and more configurable.
There is also an Ansible role to automate creation of a gobuilder image: https://github.com/meAmidos/ansible-build-go-builder
Content type
Image
Digest
Size
89.3 MB
Last updated
almost 10 years ago
docker pull amidos/gobuilder