File tree 1 file changed +8
-10
lines changed
1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change 9
9
#
10
10
# docker run -i --rm -p 8081:8081 springboot/sample-demo
11
11
# ###
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
15
13
16
14
# Build dependency offline to streamline build
17
15
COPY pom.xml .
@@ -21,12 +19,12 @@ COPY src src
21
19
RUN mvn package -Dmaven.test.skip=true
22
20
# compute the created jar name and put it in a known location to copy to the next layer.
23
21
# 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
30
25
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
31
28
EXPOSE 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