--mount=type=cache in buildkit
问题 I'm trying to get maven offline builds working from within a docker container. I've enabled buildkit. I've run mvn dependency:go-offline -s ~/checkouts/settings.xml to cache the dependencies in /root/.m2 of host machine. I wish to use this inside the container that builds maven project. Here is my Dockerfile: #syntax=docker/dockerfile:experimental FROM maven:3.6.1-jdk-11 AS build WORKDIR / COPY . / RUN --mount=type=cache,target=/root/.m2 mvn -o install FROM scratch COPY --from=build /admin