You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following Dockerfile would work wonderfully if we somehow could cache the deps for the wildfly-jar-maven-plugin in the dependencies phase.
Something like mvn wildfly-jar:go-offline.
FROM maven:3-openjdk-11 as dependencies
WORKDIR /opt/app
COPY pom.xml /opt/app
# Download deps (this layer gets cached)RUN mvn -Dmaven.repo.local=/opt/app/m2 --no-transfer-progress \
de.qaware.maven:go-offline-maven-plugin:resolve-dependencies
# Application buildFROM maven:3-openjdk-11 as build
WORKDIR /opt/app
# Copy deps from `dependencies` phaseCOPY --from=dependencies /opt/app/m2 /opt/app/m2
# copy files need to build the applicationCOPY scripts /opt/app/scripts
COPY pom.xml /opt/app/
COPY src/ /opt/app/src/
# Do the build # Unfortunately 😢 the deps for the wildfly jar plugin are not cached in the first phase# resulting in 296 files being downloaded everytimeRUN mvn -Dmaven.repo.local=/opt/app/m2 package -B --no-transfer-progress
FROM openjdk:11-jdk-slim as assemble
# App artifactCOPY --from=build /opt/app/target/*.jar /app/app.jar
ENTRYPOINT ["/usr/local/openjdk-11/bin/java", "-jar", "/app/app.jar"]
Had we any way to download all dependencies based on the pom.xml, the docker workflow would be much better.
The text was updated successfully, but these errors were encountered:
Hi.
The following Dockerfile would work wonderfully if we somehow could cache the deps for the wildfly-jar-maven-plugin in the
dependencies
phase.Something like
mvn wildfly-jar:go-offline
.Had we any way to download all dependencies based on the
pom.xml
, the docker workflow would be much better.The text was updated successfully, but these errors were encountered: