From bb03d5bce4e6b65136948d8e690a7f4722ecba47 Mon Sep 17 00:00:00 2001 From: Benjamin Schimke Date: Fri, 28 Jun 2024 14:26:28 +0200 Subject: [PATCH] remove go caching --- Dockerfile | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6113fcf7..cc8d04f3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,11 +37,6 @@ ENV GOPROXY=$goproxy COPY go.mod go.mod COPY go.sum go.sum -# Cache deps before building and copying source so that we don't need to re-download as much -# and so that source changes don't invalidate our downloaded layer -RUN --mount=type=cache,target=/go/pkg/mod \ - go mod download - # Copy the sources COPY ./ ./ @@ -51,9 +46,7 @@ ARG ARCH ARG ldflags # Do not force rebuild of up-to-date packages (do not use -a) and use the compiler cache folder -RUN --mount=type=cache,target=/root/.cache/go-build \ - --mount=type=cache,target=/go/pkg/mod \ - CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} \ +RUN CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} \ go build -trimpath -ldflags "${ldflags} -extldflags '-static'" \ -o manager ${package}