Skip to content

Commit c7be4fb

Browse files
authored
docs: improve Docker example with cache reuse (#5586)
1 parent 845cf8a commit c7be4fb

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

docs/src/docs/welcome/install.mdx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,22 @@ The scoop package is not officially maintained by golangci team.
133133
### Docker
134134

135135
```bash
136-
docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:{.LatestVersion} golangci-lint run -v
136+
docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:{.LatestVersion} golangci-lint run
137137
```
138138

139-
Preserving cache between consecutive runs:
139+
Colored output:
140140
```bash
141-
docker run --rm -v $(pwd):/app -v ~/.cache/golangci-lint/{.LatestVersion}:/root/.cache -w /app golangci/golangci-lint:{.LatestVersion} golangci-lint run -v
141+
docker run -t --rm -v $(pwd):/app -w /app golangci/golangci-lint:{.LatestVersion} golangci-lint run
142142
```
143143

144-
Colored output:
144+
Preserving caches between consecutive runs:
145145
```bash
146-
docker run -t --rm -v $(pwd):/app -w /app golangci/golangci-lint:{.LatestVersion} golangci-lint run -v
146+
docker run --rm -t -v $(pwd):/app -w /app \
147+
--user $(id -u):$(id -g) \
148+
-v $(go env GOCACHE):/.cache/go-build -e GOCACHE=/.cache/go-build \
149+
-v $(go env GOMODCACHE):/.cache/mod -e GOMODCACHE=/.cache/mod \
150+
-v ~/.cache/golangci-lint:/.cache/golangci-lint -e GOLANGCI_LINT_CACHE=/.cache/golangci-lint \
151+
golangci/golangci-lint:{.LatestVersion} golangci-lint run
147152
```
148153

149154
### Install from Sources

0 commit comments

Comments
 (0)