Skip to content

Commit 1964693

Browse files
committed
ci: speed up a couple Dockerfile targets w/ cache mount
The local Go package module path was missing from a couple of jobs, which made them slower than needed since they were re-downloading a bunch of dependencies. In particular, this makes `make lint` waaaay faster! Signed-off-by: Milas Bowman <[email protected]>
1 parent dc74e6a commit 1964693

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)