This is my docker bootstrap project for golang.
- full dockerized stack
- nothing to put in your ~/go path
- vendors management with dep
- code style lint & check
- gitlab ci pipeline
- go binary build after every file update
In order to use this bootstrap for another project:
- rename the
src/github.com/mRoca/golang-docker-bootstrap
folder path - change all the
github.com/mRoca/golang-docker-bootstrap
strings - run a
make
command - start coding
Usage:
docker run --rm mroca/golang-docker-bootstrap say -text test
- Make
- Docker
- Docker-compose
- Make
- Go
- Dep
- inotifywait (dev)
make
See the Makefile :-)
See https://github.com/golang/go/wiki/CodeReviewComments
Check the cs
make test-cs
Fix the cs
make fix-cs
All the go commands are run in the cli
docker container. If you want to use this project on your host, or if you want to be able to use autocompletion in your favorite IDE,
you can easily add it to your GOPATH variable :
export GOPATH=$HOME/go:$THIS_PROJECT_DIRECTORY
See https://github.com/golang/go/wiki/SettingGOPATH for more informations.
bin/exec command
bin/exec dep ensure -add github.com/foo/bar github.com/baz/quux
make build-prod
docker run --rm golang-docker-bootstrap say -text test