Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit d543ef3

Browse files
committed
build: Include go cache where module cache is used
Signed-off-by: Chris Crone <[email protected]>
1 parent dbd936b commit d543ef3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ RUN apk add --no-cache -vv \
2929
protobuf-dev
3030
COPY go.* .
3131
RUN --mount=type=cache,target=/go/pkg/mod \
32+
--mount=type=cache,target=/root/.cache/go-build \
3233
go mod download
3334

3435
FROM base AS make-protos
@@ -58,6 +59,7 @@ RUN go get github.com/docker/import-restrictions
5859
FROM import-restrictions-base AS import-restrictions
5960
RUN --mount=target=. \
6061
--mount=type=cache,target=/go/pkg/mod \
62+
--mount=type=cache,target=/root/.cache/go-build \
6163
make -f builder.Makefile import-restrictions
6264

6365
FROM base AS make-cli
@@ -113,6 +115,7 @@ RUN --mount=target=. \
113115
FROM base AS make-go-mod-tidy
114116
COPY . .
115117
RUN --mount=type=cache,target=/go/pkg/mod \
118+
--mount=type=cache,target=/root/.cache/go-build \
116119
go mod tidy
117120

118121
FROM scratch AS go-mod-tidy

0 commit comments

Comments
 (0)