Skip to content

Commit fc3c69e

Browse files
committed
docs: improve Docker example with cache reuse
1 parent 845cf8a commit fc3c69e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

docs/src/docs/welcome/install.mdx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,21 @@ 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+
Preserving caches between consecutive runs:
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 --rm -v $(pwd):/app -w /app \
142+
--user $(id -u):$(id -g) \
143+
-v $(go env GOCACHE):/root/.cache/go-build \
144+
-v $(go env GOMODCACHE):/go/pkg/mod \
145+
golangci/golangci-lint:{.LatestVersion} golangci-lint run
142146
```
143147

144148
Colored output:
145149
```bash
146-
docker run -t --rm -v $(pwd):/app -w /app golangci/golangci-lint:{.LatestVersion} golangci-lint run -v
150+
docker run -t --rm -v $(pwd):/app -w /app golangci/golangci-lint:{.LatestVersion} golangci-lint run
147151
```
148152

149153
### Install from Sources

0 commit comments

Comments
 (0)