File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 12
12
FROM registry.access.redhat.com/ubi8/openjdk-17:1.15-1.1682053058 AS builder
13
13
14
14
# Build dependency offline to streamline build
15
+ RUN mkdir project
16
+ WORKDIR /home/jboss/project
15
17
COPY pom.xml .
16
18
RUN mvn dependency:go-offline
17
19
18
20
COPY src src
19
- RUN mvn package -Dmaven.test.skip=true
21
+ RUN mvn package -Dmaven.test.skip=true
20
22
# 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
25
27
26
28
FROM 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
28
30
EXPOSE 8081
29
31
ENTRYPOINT ["/opt/jboss/container/java/run/run-java.sh" , "--server.port=8081" ]
30
32
You can’t perform that action at this time.
0 commit comments