From 04fd20ed7e86732522d6e288ca6abf9eb752fbb1 Mon Sep 17 00:00:00 2001 From: "Frederick F. Kautz IV" Date: Tue, 30 Mar 2021 21:13:06 -0700 Subject: [PATCH] cache go modules during docker build Signed-off-by: Frederick F. Kautz IV --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 15d005f4..89cc7def 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ FROM golang:1.16.2-alpine AS build WORKDIR /src RUN apk add --no-cache file +ENV GOMODCACHE /root/.cache/gocache RUN --mount=target=. --mount=target=/root/.cache,type=cache \ CGO_ENABLED=0 go build -o /out/dagger ./cmd/dagger && file /out/dagger | grep "statically linked"