A Docker image for developing, formatting, linting, building, testing and documenting Go projects
2.6K
A Docker image with preinstalled tools for developing, mocking, formatting, linting, building, testing and documenting Go projects.
GitLab project repository: https://gitlab.com/tymonx/docker-go
mockgen tool for generating mocks for testinggoimports toolgofmt toolerrcheck toolrevive, the golangci-lint and the golint toolscolordiff toolrichgo toolcolumn toolgo tool cover toolDownload the docker-run.sh helper script:
wget -O docker-run.sh https://gitlab.com/tymonx/docker-go/-/raw/master/docker-run.sh
Make it executable:
chmod a+x ./docker-run.sh
Run the docker-run.sh script without any arguments to work in Docker container:
./docker-run.sh
Or pass arguments to the docker-run.sh script to execute commands inside Docker container:
./docker-run.sh go build ./...
Use the go-mock command to create mocks for all automatically detected Go interfaces:
./docker-run.sh go-mock
Use the go-format command to automatically reformat Go source files:
./docker-run.sh go-format
Use the go-lint command to run various Go linters on Go source files with enabled colorization:
./docker-run.sh go-lint
Use the go-build command to build Go source files. Equivalent to the go build ./... execution:
./docker-run.sh go-build
Use the go-test command to run tests and validate coverage result with enabled colorization:
./docker-run.sh go-test
Use the go-test-no-cover command to run tests without coverage:
./docker-run.sh go-test-no-cover
To run only a single test:
./docker-run.sh go-test -run <TestName> ./...
Use the go-doc command to run Go source code documentation server for your project on default localhost:6060:
./docker-run.sh go-doc
All commands accept standard Go paths as additional arguments like ./, ./..., ./<path> and so on.
Content type
Image
Digest
Size
336.3 MB
Last updated
over 5 years ago
docker pull tymonx/go