From ab5a8d001bbfe663e775104bf23f9ea51460d30f Mon Sep 17 00:00:00 2001 From: nitrocode <7775707+nitrocode@users.noreply.github.com> Date: Mon, 6 Feb 2023 22:54:19 -0600 Subject: [PATCH] feat(docker): download transitive dependencies --- Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Dockerfile b/Dockerfile index 21b17e736f..bf98632354 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 \