You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "Croway (via GitHub)" <gi...@apache.org> on 2026/05/27 15:35:41 UTC

[PR] CAMEL-23601: camel-jbang - export layered Docker packaging for Main and Spring Boot [camel]

Croway opened a new pull request, #23568:
URL: https://github.com/apache/camel/pull/23568

   ## Summary
   
   - **Camel Main**: Dockerfiles now use layered packaging — dependencies are copied to `target/lib/` via `maven-dependency-plugin:copy-dependencies`, and the thin `.original` JAR is copied separately. On code-only changes, only the ~6 KB application layer is invalidated instead of the full 10+ MB fat JAR.
   - **Spring Boot**: Dockerfiles use a multi-stage build with Spring Boot's `jarmode=tools extract --layers` to split the fat JAR into 4 Docker layers (dependencies, spring-boot-loader, snapshot-dependencies, application). Uses the new `jarmode=tools` syntax (replacing the deprecated `jarmode=layertools` removed in Spring Boot 4.1).
   - **Quarkus**: Already uses fast-jar layered packaging. `--quarkus-package-type` is now deprecated and hidden — Quarkus always uses fast-jar.
   - Runtime-specific Dockerfile templates: `Dockerfile21.ftl`/`Dockerfile25.ftl` for Camel Main, `Dockerfile-spring-boot21.ftl`/`Dockerfile-spring-boot25.ftl` for Spring Boot. Selection is driven by `ExportSpringBoot.getDockerfileTemplateName()`.
   - `main-pom.ftl` adds `maven-jar-plugin` (classpath manifest) and `maven-dependency-plugin:copy-dependencies` to 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
   
   - [x] Unit tests pass (`TemplateHelperTest` — 23 tests, `ExportTest` — 69 tests)
   - [x] Exported Camel Main, Spring Boot, and Quarkus projects with `camel export`
   - [x] Built all three with `mvn package`
   - [x] Verified JARs run locally (`java -jar`)
   - [x] Verified thin JAR + `lib/` runs for Camel Main
   - [x] Built Docker images for all three runtimes
   - [x] Ran all three Docker containers successfully
   
   _Claude Code on behalf of Federico Mariani_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-23601: camel-jbang - export layered Docker packaging for Main and Spring Boot [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #23568:
URL: https://github.com/apache/camel/pull/23568#discussion_r3312023315


##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportQuarkus.java:
##########
@@ -318,16 +318,13 @@ protected String applicationPropertyLine(String key, String value) {
     @Override
     protected void copyDockerFiles(String buildDir) throws Exception {
         Path dockerSrc = Path.of(buildDir).resolve("src/main/docker");
-        if ("uber-jar".equals(quarkusPackageType)) {
-            // For uber-jar, the generic Dockerfile works as-is
-            super.copyDockerFiles(buildDir);
-        } else {
-            // For fast-jar, use a Quarkus-specific JVM Dockerfile
-            Files.createDirectories(dockerSrc);
-            InputStream is
-                    = ExportQuarkus.class.getClassLoader().getResourceAsStream("quarkus-docker/Dockerfile.jvm");
+        Files.createDirectories(dockerSrc);
+
+        // Use Quarkus-specific layered Dockerfile (fast-jar)

Review 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.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-23601: camel-jbang - export layered Docker packaging for Main and Spring Boot [camel]

Posted by "Croway (via GitHub)" <gi...@apache.org>.
Croway commented on PR #23568:
URL: https://github.com/apache/camel/pull/23568#issuecomment-4556322631

   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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-23601: camel-jbang - export layered Docker packaging for Main and Spring Boot [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #23568:
URL: https://github.com/apache/camel/pull/23568#issuecomment-4556405055

   :star2: Thank you for your contribution to the Apache Camel project! :star2:
     :robot: CI automation will test this PR automatically.
   
     :camel: Apache Camel Committers, please review the following items:
   
     * First-time contributors **require MANUAL approval** for the GitHub Actions to run
     * You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
     * You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
     * Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
     
     :warning: Be careful when sharing logs. Review their contents before sharing them publicly.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-23601: camel-jbang - export layered Docker packaging for Main and Spring Boot [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #23568:
URL: https://github.com/apache/camel/pull/23568#issuecomment-4557022214

   <!-- ci-tested-modules -->
   :test_tube: **CI tested the following changed modules:**
   
   - `docs`
   - `dsl/camel-jbang/camel-jbang-core`
   
   :warning: **Some tests are disabled on GitHub Actions** (`@DisabledIfSystemProperty(named = "ci.env.name")`) and require manual verification:
   
   - `dsl/camel-jbang/camel-jbang-core`: 1 test(s) disabled on GitHub Actions
   
   :bulb: **Manual integration tests recommended:**
   
   > You modified `dsl/camel-jbang/camel-jbang-core`. The related integration tests in `dsl/camel-jbang/camel-jbang-it` are excluded from CI. Consider running them manually:
   > ```
   > mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
   > ```
   
   <details><summary>All tested modules (6 modules)</summary>
   
   - Camel :: JBang :: Core
   - Camel :: JBang :: MCP
   - Camel :: JBang :: Plugin :: Route Parser
   - Camel :: JBang :: Plugin :: TUI
   - Camel :: JBang :: Plugin :: Validate
   - Camel :: Launcher :: Container
   
   </details>
   
   ---
   :gear: [View full build and test results](https://github.com/apache/camel/actions/runs/26525294932)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-23601: camel-jbang - export layered Docker packaging for Main and Spring Boot [camel]

Posted by "Croway (via GitHub)" <gi...@apache.org>.
Croway merged PR #23568:
URL: https://github.com/apache/camel/pull/23568


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org