Skip to content

Commit

Permalink
feat(docker): download transitive dependencies (#3107)
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrocode authored Feb 7, 2023
1 parent 42ee395 commit a6c09f7
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 a6c09f7

Please sign in to comment.