Skip to content

Commit

Permalink
feat(docker): download transitive dependencies (runatlantis#3107)
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrocode authored and ijames-gc committed Feb 13, 2024
1 parent d697b63 commit a04e0d7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit a04e0d7

Please sign in to comment.