FROM tomcat:11 # install maven RUN apt update && DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends maven && rm -rf /var/lib/apt/lists/* # copy war COPY target/mavor.war /usr/local/tomcat/webapps/ROOT.war # create temporary directory, no need to be a volume RUN mkdir /mavor # this mvn command fails but is intended to fail # it just initializes maven subsystem so the first # download on the website is faster RUN /usr/bin/mvn dependency:copy-dependencies || echo "maven init done. fail is intended" # set required ENV ENV MAVOR_MAVEN_EXECUTABLE="/usr/bin/mvn" ENV MAVOR_TEMP_DIR="/mavor"