CAMEL-23601: camel-jbang - export layered Docker packaging for Main and Spring Boot#23568
Conversation
437b3d9 to
3893bec
Compare
3893bec to
de299e8
Compare
davsclaus
left a comment
There was a problem hiding this comment.
Nice work on the layered Docker packaging — the per-runtime approach is well designed and the upgrade guide entry is clear.
One minor consistency note: ExportQuarkus.copyDockerFiles() now always generates a fast-jar Dockerfile, but the deprecated --quarkus-package-type option is still partially functional (line 150 selects the appJar path, line 386 passes QuarkusPackageType to the POM template which sets quarkus.package.jar.type). If a user passes --quarkus-package-type uber-jar, Quarkus will build an uber-jar but the generated Dockerfile will expect fast-jar layout. Since the option is deprecated and hidden this isn't blocking, but you might consider either emitting a warning when uber-jar is passed, or removing the remaining uber-jar logic entirely.
Also a minor question: the JDK 21 Spring Boot template uses ubi9/openjdk-21:1.23 for the builder stage and ubi9/openjdk-21-runtime:1.24 for the runtime stage — are these the intended versions, or should both use the same release?
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
| = ExportQuarkus.class.getClassLoader().getResourceAsStream("quarkus-docker/Dockerfile.jvm"); | ||
| Files.createDirectories(dockerSrc); | ||
|
|
||
| // Use Quarkus-specific layered Dockerfile (fast-jar) |
There was a problem hiding this comment.
Minor consistency concern: the uber-jar branch is removed here, but quarkusPackageType is still used at line 150 (to select the appJar path) and line 386 (passed to the POM template as QuarkusPackageType). If someone passes --quarkus-package-type uber-jar (deprecated but accepted), Quarkus will produce an uber-jar but this Dockerfile will expect fast-jar layout.
Since the option is deprecated and hidden, this is a low-risk edge case — but worth considering a warning or removing the remaining uber-jar references entirely.
|
Good point @davsclaus , I'll update the docker base image to the latest, and use ubi9 for java25, for the quarkus part, I'll leave as it was, the property is deprecated, once we remove the property, we'll remove the uber-jar handling as well |
de299e8 to
9f7b234
Compare
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
9f7b234 to
93b2fe3
Compare
|
🧪 CI tested the following changed modules:
💡 Manual integration tests recommended:
All tested modules (6 modules)
|
Summary
target/lib/viamaven-dependency-plugin:copy-dependencies, and the thin.originalJAR is copied separately. On code-only changes, only the ~6 KB application layer is invalidated instead of the full 10+ MB fat JAR.jarmode=tools extract --layersto split the fat JAR into 4 Docker layers (dependencies, spring-boot-loader, snapshot-dependencies, application). Uses the newjarmode=toolssyntax (replacing the deprecatedjarmode=layertoolsremoved in Spring Boot 4.1).--quarkus-package-typeis now deprecated and hidden.Dockerfile21.ftl/Dockerfile25.ftlfor Camel Main,Dockerfile-spring-boot21.ftl/Dockerfile-spring-boot25.ftlfor Spring Boot. Selection is driven byExportSpringBoot.getDockerfileTemplateName().main-pom.ftladdsmaven-jar-plugin(classpath manifest) andmaven-dependency-plugin:copy-dependenciesto produce layered artifacts alongside the existing fat JAR.JIRA: https://issues.apache.org/jira/browse/CAMEL-23601
Credit to Simon Hartl for originally raising the concern.
Test plan
TemplateHelperTest— 23 tests,ExportTest— 69 tests)camel exportmvn packagejava -jar)lib/runs for Camel MainClaude Code on behalf of Federico Mariani