File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 1212FROM registry.access.redhat.com/ubi8/openjdk-17:1.15-1.1682053058 AS builder
1313
1414# Build dependency offline to streamline build
15+ RUN mkdir project
16+ WORKDIR /home/jboss/project
1517COPY pom.xml .
1618RUN mvn dependency:go-offline
1719
1820COPY src src
19- RUN mvn package -Dmaven.test.skip=true
21+ RUN mvn package -Dmaven.test.skip=true
2022# compute the created jar name and put it in a known location to copy to the next layer.
21- # If the user changes pom.xml to have a different version, or artifactId, this will find the jar
22- RUN grep version /home/jboss/ target/maven-archiver/pom.properties | cut -d '=' -f2 >.env-version
23- RUN grep artifactId /home/jboss/ target/maven-archiver/pom.properties | cut -d '=' -f2 >.env-id
24- RUN mv /home/jboss/ target/$(cat .env-id)-$(cat .env-version).jar /home/jboss/ target/export-run-artifact.jar
23+ # If the user changes pom.xml to have a different version, or artifactId, this will find the jar
24+ RUN grep version target/maven-archiver/pom.properties | cut -d '=' -f2 >.env-version
25+ RUN grep artifactId target/maven-archiver/pom.properties | cut -d '=' -f2 >.env-id
26+ RUN mv target/$(cat .env-id)-$(cat .env-version).jar target/export-run-artifact.jar
2527
2628FROM registry.access.redhat.com/ubi8/openjdk-17-runtime:1.15-1.1682053056
27- COPY --from=builder /home/jboss/target/export-run-artifact.jar /deployments/export-run-artifact.jar
29+ COPY --from=builder /home/jboss/project/ target/export-run-artifact.jar /deployments/export-run-artifact.jar
2830EXPOSE 8081
2931ENTRYPOINT ["/opt/jboss/container/java/run/run-java.sh" , "--server.port=8081" ]
3032
You can’t perform that action at this time.
0 commit comments