File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,22 +44,24 @@ ARG VERSION
4444WORKDIR /build
4545
4646# unpack the uber jar into it's components and set release properties
47- RUN java -Djarmode=layertools -jar target/app.jar extract --destination target/extracted && \
48- echo "release.version=${VERSION}" > ./target/extracted/application/BOOT-INF/classes/release.properties
47+ RUN mkdir -p BOOT-INF/classes && echo "release.version=${VERSION}" > ./BOOT-INF/classes/release.properties && \
48+ jar uf target/app.jar BOOT-INF/classes/release.properties && \
49+ java -Djarmode=tools -jar target/app.jar extract --layers --destination target/extracted
4950
5051# Choose prod or dev layer
5152FROM extract-${RELEASE} AS pre-final
5253
5354# Create the runtime image using a minimal base image
5455# and copy only necessary files from the builder image
5556FROM azul-zulu:21-jre-headless AS final
57+ WORKDIR /application
5658
5759# Copy the executable from the "pre-final" stage.
60+ COPY --from=pre-final build/target/extracted/application/ ./
5861COPY --from=pre-final build/target/extracted/dependencies/ ./
5962COPY --from=pre-final build/target/extracted/spring-boot-loader/ ./
6063COPY --from=pre-final build/target/extracted/snapshot-dependencies/ ./
61- COPY --from=pre-final build/target/extracted/application/ ./
6264
6365EXPOSE 8081
6466
65- ENTRYPOINT [ "java" , "org.springframework.boot.loader.launch.JarLauncher " ]
67+ ENTRYPOINT [ "java" , "-jar" , "app.jar " ]
You can’t perform that action at this time.
0 commit comments