Public | Automated Build

Last pushed: 18 days ago
Short Description
Docker for golang testing.
Full Description


Docker image includes golang coverage tools for testing.


The docker images includes the following golang tools.

  • [x] go-junit-report Convert go test output to junit xml
  • [x] gocov Coverage testing tool
  • [x] gocov-xml XML (Cobertura) export
  • [x] golint This is a linter for Go source code. (Golint requires Go 1.6 or later.)
  • [x] glide Package Management for Golang
  • [x] govendor Package Management for Golang
  • [x] cloc Count Lines of Code.
  • [x] blackfriday-tool a markdown processor for Go.


Copy to /usr/local/bin/coverage and change permission.

$ curl -o $GOPATH/bin/coverage
$ chmod +x $GOPATH/bin/coverage


coverage tool document:

Generate test coverage statistics for Go packages.

  -- Command Flag --
  -h | --help                    Display this help and exit
  -m | --mode                    Set coverage mode. default is "set" (set|count|atomic)
  -d | --dir                     Set store coverage folder (default is ".cover")

  -- Command Action --
  tool                           Install go dependency tools like gocov or golint.
  testing                        Run go testing for all packages
  coverage                       Generate coverage report for all packages
  junit                          Generate coverage xml report for junit plugin
  lint                           Generate Lint report for all packages
  vet                            Generate Vet report for all packages
  cloc                           Generate Count Lines of Code report for all files
  all                            Execute coverage、junit、lint、vet and cloc report

Contribute and source at

Run with docker

Pull the latest golang-testing docker image.

$ docker pull appleboy/golang-testing

docker command

Run testing in single docker command.

$ export PROJECT_PATH=/go/src/
$ docker run --rm \
    -v $(PWD):$PROJECT_PATH \
    -w=$PROJECT_PATH \
    appleboy/golang-testing \
    sh -c "coverage all"

Change PROJECT_PATH variable. Replace with your github path.

docker-compose command

Please see docker/docker-compose.yml example file. Run the following command.

$ export PROJECT_PATH=/go/src/
$ docker-compose -f docker/docker-compose.yml run golang-testing \
  sh -c "coverage all"


$ git clone
$ cd golang-testing
$ export PROJECT_PATH=/go/src/
$ docker run --rm \
    -v $(PWD):$(PROJECT_PATH) \
    -w=$(PROJECT_PATH) \
    appleboy/golang-testing \
    sh -c "make update && coverage all"
# or docker-compose command
$ docker-compose -f docker/docker-compose.yml \
    run golang-testing


Docker Pull Command
Source Repository