-
Notifications
You must be signed in to change notification settings - Fork 41.9k
Closed
Description
This ticket is to request a documentation update.
I am aware of two approaches for creating Docker images for Spring Boot applications. Below are Dockerfile snippets.
# This approach generates and runs application classes stored in the `extracted_layers/application/BOOT-INF/classes/` folder.
.
.
.
RUN java -Djarmode=layertools -jar app.jar extract --destination extracted_layers
.
.
.
ENTRYPOINT ["java", "-XX:+UseContainerSupport", "-XX:MaxRAMPercentage=75.0", "-XX:+UseG1GC", "org.springframework.boot.loader.launch.JarLauncher"]
# This approach generates and runs the application jar stored in the `extracted_layers/application/` folder
.
.
.
RUN java -Djarmode=tools -jar app.jar extract --layers --destination extracted_layers
.
.
.
ENTRYPOINT ["java", "-XX:+UseContainerSupport", "-XX:MaxRAMPercentage=75.0", "-XX:+UseG1GC", "-jar", "app.jar"]
Notice the difference in the tool used specified by -Djarmode .
The documentation mentions the jar approach: https://docs.spring.io/spring-boot/3.5/reference/packaging/container-images/dockerfiles.html
The documentation is missing mentioning the approach that generates and runs application classes using the -Djarmode=layertools options.
It would be beneficial to also document practical differences between the two different approaches.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type: enhancementA general enhancementA general enhancement