I am building application inside maven container so programmer doesn’t need to worry about version of java and maven on local machine. But i have problem with .m2, every time application is build it is downloading all dependencies from maven. Is there any way how to mount m2 to maven container during multi stage build?
Here is simplified Dockerfile for demonstration.
FROM maven:3.5.2-jdk-9 AS base_build COPY . /tmp/app WORKDIR /tmp/app\ RUN mvn clean package FROM jboss/wildfly/:11.0.0.Final COPY --from=base_build ./tmp/app/application/ear/target/cmc-ear-*.ear /opt/jboss/wildfly/standalone/deployments/