FROM maven:3-jdk-7 AS build ENV BUILD_UID=1000 ENV BUILD=/src ENV MAVEN_HOME=/var/maven RUN mkdir -p $MAVEN_HOME && chown $BUILD_UID $MAVEN_HOME ADD --chown=$BUILD_UID:$BUILD_UID .. $BUILD USER $BUILD_UID WORKDIR $BUILD RUN --mount=type=cache,target=$MAVEN_HOME/.m2,uid=$BUILD_UID \ mvn -e -Duser.home=$MAVEN_HOME package FROM openjdk:7u211-jre-alpine RUN <