Skip to content

Commit

Permalink
Update docker file to use cds
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheikah45 committed Jul 4, 2024
1 parent 3f2927e commit b7507e0
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@ FROM eclipse-temurin:21-jdk-alpine as builder
WORKDIR /application
ARG JAR_FILE=build/libs/faf-java-api-*.jar
COPY ${JAR_FILE} application.jar
RUN java -Djarmode=layertools -jar application.jar extract
COPY test-pki-private.key pki/secret.key
COPY test-pki-public.key pki/public.key
RUN java -Djarmode=tools -jar application.jar extract
RUN java -Dspring.context.exit=onRefresh -XX:ArchiveClassesAtExit=application.jsa -jar application/application.jar

FROM eclipse-temurin:21-jdk-alpine
VOLUME /tmp
WORKDIR /application
COPY --from=builder /application/dependencies/ ./
COPY --from=builder /application/application/lib ./
RUN true
COPY --from=builder /application/spring-boot-loader/ ./
COPY --from=builder /application/application/application.jar ./
RUN true
COPY --from=builder /application/snapshot-dependencies/ ./
COPY --from=builder /application/application/application.jsa ./
RUN true
COPY --from=builder /application/application/ ./
RUN true
ENTRYPOINT ["java", "-server", "-Djava.security.egd=file:/dev/./urandom", "org.springframework.boot.loader.launch.JarLauncher"]
ENTRYPOINT ["java", "-XX:SharedArchiveFile=application.jsa", "-Djava.security.egd=file:/dev/./urandom", "-jar", "application.jar"]

0 comments on commit b7507e0

Please sign in to comment.