Skip to content

Remove support for the deprecated layertools jar mode #48568

@pfrollo

Description

@pfrollo

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions