Skip to content

Commit

Permalink
Merge pull request #10793 from milas/dockerfile-cache-mounts
Browse files Browse the repository at this point in the history
ci: speed up a couple Dockerfile targets w/ cache mount
  • Loading branch information
glours authored Jul 10, 2023
2 parents dc74e6a + 1964693 commit e28b223
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ FROM build-base AS lint
ARG BUILD_TAGS
RUN --mount=type=bind,target=. \
--mount=type=cache,target=/root/.cache \
--mount=type=cache,target=/go/pkg/mod \
--mount=from=golangci-lint,source=/usr/bin/golangci-lint,target=/usr/bin/golangci-lint \
golangci-lint run --build-tags "$BUILD_TAGS" ./...

Expand Down Expand Up @@ -129,6 +130,7 @@ FROM base AS docsgen
WORKDIR /src
RUN --mount=target=. \
--mount=target=/root/.cache,type=cache \
--mount=type=cache,target=/go/pkg/mod \
go build -o /out/docsgen ./docs/yaml/main/generate.go

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

0 comments on commit e28b223

Please sign in to comment.