From d543ef30649454f03798beceb6f7a5b2811753fc Mon Sep 17 00:00:00 2001 From: Chris Crone Date: Wed, 19 May 2021 14:59:21 +0000 Subject: [PATCH] build: Include go cache where module cache is used Signed-off-by: Chris Crone --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 726992a4a..a77882d8c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,6 +29,7 @@ RUN apk add --no-cache -vv \ protobuf-dev COPY go.* . RUN --mount=type=cache,target=/go/pkg/mod \ + --mount=type=cache,target=/root/.cache/go-build \ go mod download FROM base AS make-protos @@ -58,6 +59,7 @@ RUN go get github.com/docker/import-restrictions FROM import-restrictions-base AS import-restrictions RUN --mount=target=. \ --mount=type=cache,target=/go/pkg/mod \ + --mount=type=cache,target=/root/.cache/go-build \ make -f builder.Makefile import-restrictions FROM base AS make-cli @@ -113,6 +115,7 @@ RUN --mount=target=. \ FROM base AS make-go-mod-tidy COPY . . RUN --mount=type=cache,target=/go/pkg/mod \ + --mount=type=cache,target=/root/.cache/go-build \ go mod tidy FROM scratch AS go-mod-tidy