Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kovayur committed Jul 9, 2024
1 parent b2e835c commit 40643bd
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 @@ -8,6 +8,13 @@ WORKDIR /src
RUN go env -w GOCACHE=/go/.cache; \
go env -w GOMODCACHE=/go/pkg/mod

# Use the docker build cache to avoid calling 'go mod download' if go.mod/go.sum have not been changed.
# Otherwise, use cache mount to cache dependencies between builds.
# mount=type=bind is intentionally not used to ensure compatibility between docker and podman.
# See:
# - https://docs.docker.com/build/cache/
# - https://docs.docker.com/build/guide/mounts/
# - https://github.com/containers/podman/issues/15423
COPY go.* ./
RUN --mount=type=cache,target=/go/pkg/mod/ \
go mod download
Expand Down

0 comments on commit 40643bd

Please sign in to comment.