This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 0cbecb8e3e22 CAMEL-23139: Adds Camel Launcher Dockerfile (#21769)
0cbecb8e3e22 is described below
commit 0cbecb8e3e22c3341457c9b37f94381cffcc16ab
Author: Marco Carletti <[email protected]>
AuthorDate: Fri Mar 6 20:56:55 2026 +0100
CAMEL-23139: Adds Camel Launcher Dockerfile (#21769)
---
.../camel-launcher-container/Dockerfile | 47 +++++++++
.../camel-launcher-container/README.adoc | 82 +++++++++++++++
dsl/camel-jbang/camel-launcher-container/pom.xml | 114 +++++++++++++++++++++
dsl/camel-jbang/camel-launcher-container/run.sh | 19 ++++
dsl/camel-jbang/pom.xml | 1 +
5 files changed, 263 insertions(+)
diff --git a/dsl/camel-jbang/camel-launcher-container/Dockerfile
b/dsl/camel-jbang/camel-launcher-container/Dockerfile
new file mode 100644
index 000000000000..b4d58ccdfa10
--- /dev/null
+++ b/dsl/camel-jbang/camel-launcher-container/Dockerfile
@@ -0,0 +1,47 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+FROM ${container.base-image}
+
+LABEL org.opencontainers.image.title="Apache Camel Launcher" \
+ org.opencontainers.image.description="Self-contained executable JAR for
running Apache Camel JBang without requiring JBang installed" \
+ org.opencontainers.image.version="${camel-launcher.version}" \
+ org.opencontainers.image.vendor="Apache Software Foundation" \
+ org.opencontainers.image.authors="[email protected]" \
+ org.opencontainers.image.url="https://camel.apache.org/" \
+
org.opencontainers.image.documentation="https://camel.apache.org/manual/camel-jbang.html"
\
+ org.opencontainers.image.source="https://github.com/apache/camel" \
+ org.opencontainers.image.licenses="Apache-2.0"
+
+# Set Camel version
+ENV CAMEL_VERSION=${camel-launcher.version}
+
+# Install the Camel Launcher
+ENV CAMEL_HOME=/opt/camel
+RUN mkdir -p $CAMEL_HOME/bin && chown -R ${container.user}:${container.user}
$CAMEL_HOME
+
+ENV PATH="$PATH:$CAMEL_HOME/bin"
+
+USER ${container.user}
+
+COPY --chown=${container.user}:${container.user}
camel-launcher-${CAMEL_VERSION}.jar $CAMEL_HOME/bin/camel-launcher.jar
+COPY --chown=${container.user}:${container.user} run.sh $CAMEL_HOME/bin/camel
+
+RUN chmod +x $CAMEL_HOME/bin/camel && \
+ camel version
+
+ENTRYPOINT ["camel"]
diff --git a/dsl/camel-jbang/camel-launcher-container/README.adoc
b/dsl/camel-jbang/camel-launcher-container/README.adoc
new file mode 100644
index 000000000000..7e93df68ced6
--- /dev/null
+++ b/dsl/camel-jbang/camel-launcher-container/README.adoc
@@ -0,0 +1,82 @@
+= Camel Launcher Container
+
+== Overview
+
+This module provides the Docker container image for the Camel Launcher, a
self-contained executable JAR that includes all dependencies required to run
Camel JBang without needing JBang installed.
+
+The Maven build gathers all required resources into `target/docker/`, ready
for building the container image.
+
+== Building
+
+First, build the module and its dependencies. By default, it uses the current
project version:
+
+[source,bash]
+----
+mvn clean package -pl dsl/camel-jbang/camel-launcher-container -am -Dquickly
+----
+
+To use a specific released version of camel-launcher instead:
+
+[source,bash]
+----
+mvn clean package -pl dsl/camel-jbang/camel-launcher-container
-Dcamel-launcher.version=4.18.0
+----
+
+This produces the following layout in `target/docker/`:
+
+----
+target/docker/
+├── Dockerfile
+├── camel-launcher-<version>.jar
+└── run.sh
+----
+
+Then build the container image:
+
+[source,bash]
+----
+cd dsl/camel-jbang/camel-launcher-container
+podman build -t camel-launcher target/docker/
+----
+
+== Running
+
+[source,bash]
+----
+podman run --rm camel-launcher version
+podman run --rm -v $(pwd)/routes:/routes camel-launcher run /routes/hello.java
+----
+
+== Configuration
+
+The following Maven properties can be overridden at build time:
+
+[cols="3,2,4"]
+|===
+| Property | Default | Description
+
+| `camel-launcher.version`
+| `${project.version}`
+| Version of the camel-launcher JAR to include
+
+| `container.base-image`
+| `eclipse-temurin:21-jre`
+| Base container image used in the Dockerfile
+
+| `container.user`
+| `ubuntu`
+| Non-root user to run the container as
+|===
+
+For example, to use a specific camel-launcher version with a different base
image:
+
+[source,bash]
+----
+mvn clean package -pl dsl/camel-jbang/camel-launcher-container \
+ -Dcamel-launcher.version=4.18.0 \
+ -Dcontainer.base-image=eclipse-temurin:21-jre-alpine
+----
+
+== Container details
+
+The image runs as a non-root user (default `ubuntu`). The Camel Launcher JAR
is installed as `/opt/camel/bin/camel-launcher.jar` and the `run.sh` script is
installed as `/opt/camel/bin/camel`, which simply invokes `java -jar` on the
JAR. JVM options can be passed via the `JAVA_OPTS` environment variable.
diff --git a/dsl/camel-jbang/camel-launcher-container/pom.xml
b/dsl/camel-jbang/camel-launcher-container/pom.xml
new file mode 100644
index 000000000000..b78203b62011
--- /dev/null
+++ b/dsl/camel-jbang/camel-launcher-container/pom.xml
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-jbang-parent</artifactId>
+ <version>4.19.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-launcher-container</artifactId>
+ <packaging>pom</packaging>
+
+ <name>Camel :: Launcher :: Container</name>
+ <description>Camel Launcher Container resources</description>
+
+ <properties>
+ <camel-prepare-component>false</camel-prepare-component>
+ <camel-launcher.version>${project.version}</camel-launcher.version>
+ <container.base-image>eclipse-temurin:21-jre</container.base-image>
+ <container.user>ubuntu</container.user>
+ <docker.context>${project.build.directory}/docker</docker.context>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-launcher</artifactId>
+ <version>${camel-launcher.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-launcher-jar</id>
+ <phase>package</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-launcher</artifactId>
+
<version>${camel-launcher.version}</version>
+ <type>jar</type>
+
<outputDirectory>${docker.context}</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-docker-resources</id>
+ <phase>package</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+
<outputDirectory>${docker.context}</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${project.basedir}</directory>
+ <includes>
+ <include>Dockerfile</include>
+ </includes>
+ <filtering>true</filtering>
+ </resource>
+ <resource>
+ <directory>${project.basedir}</directory>
+ <includes>
+ <include>run.sh</include>
+ </includes>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/dsl/camel-jbang/camel-launcher-container/run.sh
b/dsl/camel-jbang/camel-launcher-container/run.sh
new file mode 100644
index 000000000000..e8458e293b6c
--- /dev/null
+++ b/dsl/camel-jbang/camel-launcher-container/run.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+exec java $JAVA_OPTS -jar "$CAMEL_HOME/bin/camel-launcher.jar" "$@"
diff --git a/dsl/camel-jbang/pom.xml b/dsl/camel-jbang/pom.xml
index 6b88dc86a72f..92bb045fd0df 100644
--- a/dsl/camel-jbang/pom.xml
+++ b/dsl/camel-jbang/pom.xml
@@ -46,5 +46,6 @@
<module>camel-jbang-plugin-validate</module>
<module>camel-jbang-it</module>
<module>camel-launcher</module>
+ <module>camel-launcher-container</module>
</modules>
</project>