2024-05-04 13:18:37 +05:00
|
|
|
# Go ToolBox
|
|
|
|
|
|
|
|
Docker image with everything you might need for developing apps in Go.
|
|
|
|
|
|
|
|
**Note that for newer mac hardware you have to use Docker Desktop or amd64 virtual machine in lima/other tools!**
|
|
|
|
|
|
|
|
## What's inside
|
|
|
|
|
|
|
|
Debian 12 (slim) is used as base image.
|
|
|
|
|
|
|
|
| Binary | Version | Project | Repo |
|
|
|
|
| ----------------- | ------- | --------------- | ------------------------------------------------------------- |
|
2024-07-07 20:40:05 +05:00
|
|
|
| `go` | 1.22.5 | Go | |
|
|
|
|
| `golangci-lint` | 1.59.1 | golangci-lint | [External link](https://github.com/golangci/golangci-lint) |
|
2024-05-04 13:18:37 +05:00
|
|
|
| `gofumpt` | 0.6.0 | gofumpt | [External link](https://github.com/mvdan/gofumpt) |
|
2024-07-07 20:40:05 +05:00
|
|
|
| `mockery_v2` | 2.43.2 | mockery | [External link](https://github.com/vektra/mockery) |
|
|
|
|
| `task` | 3.38.0 | taskfile | [External link](https://github.com/go-task/task) |
|
2024-05-04 13:18:37 +05:00
|
|
|
| `go-junit-report` | 2.1.0 | go-junit-report | [External link](https://github.com/jstemmer/go-junit-report) |
|
|
|
|
| `delve` | 1.22.1 | delve | [External link](https://github.com/go-delve/delve) |
|
|
|
|
|
|
|
|
## HOME
|
|
|
|
|
|
|
|
Home directory is `/home/container`.
|
|
|
|
|
|
|
|
## Caching
|
|
|
|
|
|
|
|
Go's build cache resides in `/home/container/.cache`, `GOCACHE` environment variable is defined. You can mount it when needed in Dockerfile as:
|
|
|
|
|
|
|
|
```Dockerfile
|
|
|
|
RUN --mount=type=cache,target="$GOCACHE" go build
|
|
|
|
```
|
|
|
|
|
|
|
|
## Utilities examples
|
|
|
|
|
|
|
|
### JUnit report generation (for Gitlab)
|
|
|
|
|
|
|
|
```shell
|
|
|
|
go test -v 2>&1 ./... | go-junit-report -set-exit-code > unit-report.xml
|
|
|
|
```
|