What does `--mount=type=bind` do in `RUN`?
AdvancedConceptDockerfile Instructions & Builds
Answer
It mounts files from the build context or another stage read-only into a RUN step without copying them into a layer. Good for using a lockfile or source only during a build step.
RUN --mount=type=bind,source=go.mod,target=go.mod \
--mount=type=bind,source=go.sum,target=go.sum \
go mod download