From 19646930741c23343d3ed35f3297be22cbd1f97e Mon Sep 17 00:00:00 2001 From: Milas Bowman Date: Mon, 10 Jul 2023 12:26:16 -0400 Subject: [PATCH] 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 --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 3ded2db4a..1d887363d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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" ./... @@ -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