File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change 99#
1010# docker run -i --rm -p 8081:8081 springboot/sample-demo
1111# ###
12- FROM quay.io/devfile/maven:3.8.1-openjdk-17-slim
13-
14- WORKDIR /build
12+ FROM registry.access.redhat.com/ubi8/openjdk-17:1.14 AS builder
1513
1614# Build dependency offline to streamline build
1715COPY pom.xml .
@@ -21,12 +19,12 @@ COPY src src
2119RUN mvn package -Dmaven.test.skip=true
2220# compute the created jar name and put it in a known location to copy to the next layer.
2321# If the user changes pom.xml to have a different version, or artifactId, this will find the jar
24- RUN grep version /build/target/maven-archiver/pom.properties | cut -d '=' -f2 >.env-version
25- RUN grep artifactId /build/target/maven-archiver/pom.properties | cut -d '=' -f2 >.env-id
26- RUN mv /build/target/$(cat .env-id)-$(cat .env-version).jar /build/target/export-run-artifact.jar
27-
28- FROM openjdk:11-jdk
29- COPY --from=0 /build/target/export-run-artifact.jar /app/target/export-run-artifact.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
3025
26+ FROM registry.access.redhat.com/ubi8/openjdk-17-runtime:1.15
27+ COPY --from=builder /home/jboss/target/export-run-artifact.jar /deployments/export-run-artifact.jar
3128EXPOSE 8081
32- ENTRYPOINT [ "java" , "-jar" , "/app/target/export-run-artifact.jar" , "--server.port=8081" ]
29+ ENTRYPOINT ["/opt/jboss/container/java/run/run-java.sh" , "--server.port=8081" ]
30+
You can’t perform that action at this time.
0 commit comments