Skip to content

Commit e28b223

Browse files
authored
Merge pull request docker#10793 from milas/dockerfile-cache-mounts
ci: speed up a couple Dockerfile targets w/ cache mount
2 parents dc74e6a + 1964693 commit e28b223

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ FROM build-base AS lint
9191
ARG BUILD_TAGS
9292
RUN --mount=type=bind,target=. \
9393
--mount=type=cache,target=/root/.cache \
94+
--mount=type=cache,target=/go/pkg/mod \
9495
--mount=from=golangci-lint,source=/usr/bin/golangci-lint,target=/usr/bin/golangci-lint \
9596
golangci-lint run --build-tags "$BUILD_TAGS" ./...
9697

@@ -129,6 +130,7 @@ FROM base AS docsgen
129130
WORKDIR /src
130131
RUN --mount=target=. \
131132
--mount=target=/root/.cache,type=cache \
133+
--mount=type=cache,target=/go/pkg/mod \
132134
go build -o /out/docsgen ./docs/yaml/main/generate.go
133135

134136
FROM --platform=${BUILDPLATFORM} alpine AS docs-build

0 commit comments

Comments
 (0)