[ 
https://issues.apache.org/jira/browse/CAMEL-25495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-25495.
---------------------------------
    Resolution: Fixed

Fixed by https://github.com/apache/camel/pull/27617 (merged as 
f4ac7fb1c76e554b662fe2ad0ef74b23c1029681). Thanks Thomas Raddatz.

_Claude Code on behalf of Claus Ibsen_

> camel-jbang - camel export --runtime=quarkus ignores --java-version in the 
> generated Dockerfile
> -----------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-25495
>                 URL: https://issues.apache.org/jira/browse/CAMEL-25495
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-jbang
>    Affects Versions: 4.22.1
>            Reporter: Thomas Raddatz
>            Priority: Minor
>             Fix For: 4.23.0
>
>
> {{camel export \-\-runtime=quarkus}} writes {{src/main/docker/Dockerfile}} 
> and {{Dockerfile.jvm}} with a fixed base image, 
> {{registry.access.redhat.com/ubi9/openjdk-21-runtime:1.24}}, whatever 
> {{\-\-java-version}} says. With {{\-\-java-version=25}} the exported project 
> is compiled for Java 25 ({{maven.compiler.release}} is 25), but the image 
> runs it on a Java 21 runtime, so the container cannot start 
> ({{UnsupportedClassVersionError}}).
> Camel Main and Spring Boot pick their Dockerfile template by 
> {{\-\-java-version}} ({{Dockerfile21.ftl}} / {{Dockerfile25.ftl}}, 
> {{Dockerfile-spring-boot21.ftl}} / {{Dockerfile-spring-boot25.ftl}}, 
> CAMEL-23088). The Quarkus fast-jar Dockerfile 
> ({{quarkus-docker/Dockerfile.jvm}}, added with CAMEL-23192) is copied 
> verbatim and never got a Java 25 variant. The Quarkus {{uber-jar}} package 
> type is not affected: it uses the Camel Main template.
> To reproduce:
> {code:bash}
> camel init cheese.yaml
> camel export cheese.yaml --runtime=quarkus --java-version=25 
> --gav=org.example:cheese:1.0.0 --dir=cheese
> grep '^FROM' cheese/src/main/docker/Dockerfile 
> cheese/src/main/docker/Dockerfile.jvm
> {code}
> {code:none}
> cheese/src/main/docker/Dockerfile:FROM 
> registry.access.redhat.com/ubi9/openjdk-21-runtime:1.24
> cheese/src/main/docker/Dockerfile.jvm:FROM 
> registry.access.redhat.com/ubi9/openjdk-21-runtime:1.24
> {code}
> Expected: {{ubi9/openjdk-25-runtime}} for {{\-\-java-version=25}}, as for the 
> other runtimes.
> Checked on 4.22.1, on the camel-4.22.x branch and on main. The workaround is 
> to raise the base image of the exported Dockerfiles after the export.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to