From 495446defcccae35b021f061e3b2c38b1e3e2fc0 Mon Sep 17 00:00:00 2001 From: nitrocode <7775707+nitrocode@users.noreply.github.com> Date: Tue, 7 Feb 2023 00:16:29 -0600 Subject: [PATCH] feat(docker): download transitive dependencies (#3107) --- Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Dockerfile b/Dockerfile index eb567cbc47..9bd728f6d1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,13 @@ ARG ATLANTIS_DATE=unknown ENV ATLANTIS_DATE=${ATLANTIS_DATE} WORKDIR /app + +# This is needed to download transitive dependencies instead of compiling them +# https://github.com/montanaflynn/golang-docker-cache +# https://github.com/golang/go/issues/27719 +COPY go.mod go.sum ./ +RUN go mod graph | awk '{if ($1 !~ "@") print $2}' | xargs go get + COPY . /app RUN --mount=type=cache,target=/go/pkg/mod \