This is an automated email from the ASF dual-hosted git repository.

squakez 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 284c77814aa4 feat(ci): Camel JBang container release process
284c77814aa4 is described below

commit 284c77814aa4b81236dae678df3957d378c7f8d2
Author: Pasquale Congiusti <[email protected]>
AuthorDate: Mon Jun 15 12:16:24 2026 +0200

    feat(ci): Camel JBang container release process
    
    Complete automation to support:
    
    * multi jvm
    * multi architectures
    * build, push and verify
    * configuration setting in Makefile
    
    Closes CAMEL-23750
    Closes CAMEL-23752
---
 docs/user-manual/modules/ROOT/nav.adoc             |   1 +
 .../modules/ROOT/pages/camel-jbang-container.adoc  |  42 ++++++++
 dsl/camel-jbang/camel-jbang-container/Makefile     | 108 +++++++++++++++++++++
 .../camel-jbang-container/{ => build}/Dockerfile   |  26 +++--
 dsl/camel-jbang/camel-jbang-container/readme.adoc  |  60 ++++++++++++
 pom.xml                                            |   1 +
 6 files changed, 231 insertions(+), 7 deletions(-)

diff --git a/docs/user-manual/modules/ROOT/nav.adoc 
b/docs/user-manual/modules/ROOT/nav.adoc
index e010f74e5275..9f6a3fe547d3 100644
--- a/docs/user-manual/modules/ROOT/nav.adoc
+++ b/docs/user-manual/modules/ROOT/nav.adoc
@@ -12,6 +12,7 @@
 *** xref:camel-jbang-test.adoc[Camel Testing Plugin]
 *** xref:camel-jbang-tui.adoc[Camel TUI]
 *** xref:camel-jbang-mcp.adoc[Camel MCP Server]
+*** xref:camel-jbang-container.adoc[Camel CLI container]
 ** xref:camel-maven-plugin.adoc[Camel Maven Plugin]
 *** xref:camel-component-maven-plugin.adoc[Camel Component Maven Plugin]
 *** xref:camel-report-maven-plugin.adoc[Camel Maven Report Plugin]
diff --git a/docs/user-manual/modules/ROOT/pages/camel-jbang-container.adoc 
b/docs/user-manual/modules/ROOT/pages/camel-jbang-container.adoc
new file mode 100644
index 000000000000..7ed3e3fdd9b8
--- /dev/null
+++ b/docs/user-manual/modules/ROOT/pages/camel-jbang-container.adoc
@@ -0,0 +1,42 @@
+= Running Camel JBang in a Container
+
+The Camel JBang container provides a convenient way to run Camel integrations 
without installing Java, Maven, or Camel JBang locally. The official Camel 
JBang container image is equipped with the `camel` CLI and it is the default 
entrypoint.
+
+== Verify the version
+
+The simplest command you can check is the `camel version` which can be run on 
the container:
+
+[source,bash]
+----
+$ docker run apache/camel-jbang:4.18.2 version
+
+JBang version: 0.137.0
+Camel JBang version: 4.18.2
+----
+
+== Running a route
+
+You can mount a Camel route file from your host machine into the container and 
run the resulting Camel DSL directly. For example, given a route definition in 
`test.yaml` (ie, `camel init test.yaml`):
+
+[source,bash]
+----
+$ docker run -w /home/ubuntu -v $PWD/test.yaml:/tmp/test.yaml 
apache/camel-jbang:4.18.2 run /tmp/test.yaml --runtime quarkus
+
+...
+2026-06-15 12:21:13,597 INFO  
[org.apache.camel.quarkus.core.CamelBootstrapRecorder] (main) Apache Camel 
Quarkus 3.31.0 is starting
+...
+----
+
+You can use any other parameter available for the run and customize your Camel 
application.
+
+== Any other `camel` command
+
+The same logic used in the previous example with the `run` command can be also 
used with any other available command for `camel` CLI.
+
+== Container Image Availability
+
+The Camel JBang container image is published with a number of tags that 
provide different Camel, Java runtime and platform architecture combinations. 
This allows you to select the image that best matches your requirements and 
deployment environment.
+
+Available image variants, supported architectures, and Java runtime versions 
may evolve over time. Before choosing an image, verify the available tags on 
https://hub.docker.com/r/apache/camel-jbang/tags[Apache Camel Jbang Docker Hub].
+
+Docker will automatically pull the appropriate image variant for your platform 
when a multi-architecture image is available. Refer to the Docker Hub tags page 
for the most up-to-date information about supported platforms and image 
variants.
diff --git a/dsl/camel-jbang/camel-jbang-container/Makefile 
b/dsl/camel-jbang/camel-jbang-container/Makefile
new file mode 100644
index 000000000000..bf3f6cb6dbbc
--- /dev/null
+++ b/dsl/camel-jbang/camel-jbang-container/Makefile
@@ -0,0 +1,108 @@
+# 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.
+
+#
+# Use bash explicitly in this Makefile to avoid unexpected platform
+# incompatibilities among Linux distros.
+#
+SHELL := /bin/bash
+
+JBANG_VERSION = 0.138.0
+CAMEL_VERSION ?=
+
+ifndef CAMEL_VERSION
+$(error CAMEL_VERSION is required: make CAMEL_VERSION=4.21.0 ...)
+endif
+
+# Use any other for staging or test purposes
+IMAGE_NAME ?= docker.io/apache/camel-jbang
+BASE_IMAGE_NAME := eclipse-temurin
+BASE_IMAGE_VERSION := 17-jdk
+OFFICIAL_IMAGE_VERSION := 21-jdk
+BASE_IMAGE := $(BASE_IMAGE_NAME):$(BASE_IMAGE_VERSION)
+
+IMAGE_ARCH ?= $(if $(filter arm64 aarch64,$(shell uname -m)),arm64,amd64)
+OFFICIAL_IMAGE_ARCH := amd64
+
+JDK_VERSIONS = 17-jdk 21-jdk
+ARCH_VERSIONS = amd64 arm64
+
+DOCKER_TAG := 
$(IMAGE_NAME):$(CAMEL_VERSION)-$(BASE_IMAGE_VERSION)-$(IMAGE_ARCH)
+
+images-build-all:
+       for i in $(JDK_VERSIONS); do \
+               for j in $(ARCH_VERSIONS); do \
+                       make IMAGE_ARCH=$$j BASE_IMAGE_VERSION=$$i image-build; 
\
+               done \
+       done
+
+image-build:
+       @echo "####### Building Camel JBang (CLI) jdk $(BASE_IMAGE_VERSION) 
arch $(IMAGE_ARCH) container image..."
+       docker buildx build \
+               --platform=linux/$(IMAGE_ARCH) \
+               --build-arg BASE_IMAGE=$(BASE_IMAGE) \
+               --build-arg IMAGE_ARCH=$(IMAGE_ARCH) \
+               --build-arg JBANG_VERSION=$(JBANG_VERSION) \
+               --build-arg CAMEL_VERSION=$(CAMEL_VERSION) \
+               --load -t $(DOCKER_TAG) -f build/Dockerfile .
+ifeq ($(BASE_IMAGE_VERSION),$(OFFICIAL_IMAGE_VERSION))
+ifeq ($(IMAGE_ARCH),$(OFFICIAL_IMAGE_ARCH))
+       docker tag $(DOCKER_TAG) 
$(IMAGE_NAME):$(CAMEL_VERSION)-$(BASE_IMAGE_VERSION)
+       docker tag $(DOCKER_TAG) $(IMAGE_NAME):$(CAMEL_VERSION)
+endif
+       docker tag $(DOCKER_TAG) $(IMAGE_NAME):$(CAMEL_VERSION)-$(IMAGE_ARCH)
+else
+ifeq ($(IMAGE_ARCH),$(OFFICIAL_IMAGE_ARCH))
+       docker tag $(DOCKER_TAG) 
$(IMAGE_NAME):$(CAMEL_VERSION)-$(BASE_IMAGE_VERSION)
+endif
+endif
+
+IMAGE_PUSH = $(IMAGE_NAME):$(CAMEL_VERSION)
+images-push-all:
+       make images-push
+       for i in $(JDK_VERSIONS); do \
+               make IMAGE_PUSH=$(IMAGE_NAME):$(CAMEL_VERSION)-$$i images-push 
; \
+       done
+
+images-push:
+       @echo "####### Pushing Camel JBang (CLI) $(IMAGE_PUSH) container 
image..."
+       for i in $(ARCH_VERSIONS); do \
+               docker push $(IMAGE_PUSH)-$$i ; \
+               docker manifest create $(IMAGE_PUSH) -a $(IMAGE_PUSH)-$$i; \
+       done
+       docker manifest push $(IMAGE_PUSH) --purge
+
+images-release: images-build-all images-push-all images-check-all
+
+IMAGE_CHECK = $(IMAGE_NAME):$(CAMEL_VERSION)
+
+images-check-all:
+       make image-check
+       for i in $(JDK_VERSIONS); do \
+               make IMAGE_CHECK=$(IMAGE_NAME):$(CAMEL_VERSION)-$$i image-check 
; \
+       done
+
+image-check:
+       @echo "####### Checking Camel JBang (CLI) $(IMAGE_CHECK) container 
image..."
+       @EXPECTED="$(CAMEL_VERSION)"; \
+       ACTUAL=$$(docker run --rm $(IMAGE_CHECK) version | sed -n 's/^Camel 
JBang version: //p'); \
+       test "$$ACTUAL" = "$$EXPECTED"
+       @for arch in $(ARCH_VERSIONS); do \
+               echo "####### Checking $$arch"; \
+               EXPECTED="$(CAMEL_VERSION)"; \
+               ACTUAL=$$(docker run --rm --platform linux/$$arch 
$(IMAGE_CHECK) version | \
+                       sed -n 's/^Camel JBang version: //p'); \
+               test "$$ACTUAL" = "$$EXPECTED" || exit 1; \
+       done
diff --git a/dsl/camel-jbang/camel-jbang-container/Dockerfile 
b/dsl/camel-jbang/camel-jbang-container/build/Dockerfile
similarity index 60%
rename from dsl/camel-jbang/camel-jbang-container/Dockerfile
rename to dsl/camel-jbang/camel-jbang-container/build/Dockerfile
index f0519019ed91..16074522fabc 100644
--- a/dsl/camel-jbang/camel-jbang-container/Dockerfile
+++ b/dsl/camel-jbang/camel-jbang-container/build/Dockerfile
@@ -15,12 +15,16 @@
 # limitations under the License.
 #
 
-FROM eclipse-temurin:21-jdk
+ARG BASE_IMAGE=eclipse-temurin:21-jdk
 
-# Set Versions, JBang Path and commit ID of the specific version of 
dsl/camel-jbang/camel-jbang-main/dist/CamelJBang.java
-ENV JBANG_VERSION=0.138.0 \
-    CAMEL_VERSION=4.18.2 \
-    CAMEL_JBANG_COMMIT=c955dff71d90e5c5bc853edb11dd48782b588deb \
+FROM $BASE_IMAGE
+
+ARG IMAGE_ARCH
+ARG JBANG_VERSION
+ARG CAMEL_VERSION
+
+ENV JBANG_VERSION=$JBANG_VERSION \
+    CAMEL_VERSION=$CAMEL_VERSION \
     JBANG_PATH=/opt/jbang
 
 RUN mkdir $JBANG_PATH && chown ubuntu:ubuntu $JBANG_PATH
@@ -30,8 +34,16 @@ ENV PATH="$PATH:$JBANG_PATH"
 USER ubuntu
 
 # Download JBang, create camel exec, set JBang version, trust camel sources 
and download camel DEPS by running camel
-RUN bash -c set -o pipefail && wget -qc 
https://github.com/jbangdev/jbang/releases/download/v$JBANG_VERSION/jbang.tar 
-O - | tar xf - --strip-components=2 -C $JBANG_PATH jbang/bin/jbang 
jbang/bin/jbang.jar && \
-    echo '#!/bin/sh\nexec jbang run 
https://github.com/apache/camel/blob/'$CAMEL_JBANG_COMMIT'/dsl/camel-jbang/camel-jbang-main/dist/CamelJBang.java
 "$@"' > $JBANG_PATH/camel && \
+RUN bash -c set -o pipefail && wget -qc 
https://github.com/jbangdev/jbang/releases/download/v$JBANG_VERSION/jbang.tar 
-O - | \
+    tar xf - --strip-components=2 -C $JBANG_PATH jbang/bin/jbang 
jbang/bin/jbang.jar
+RUN curl -L \
+    
https://raw.githubusercontent.com/apache/camel/camel-${CAMEL_VERSION}/dsl/camel-jbang/camel-jbang-main/dist/CamelJBang.java
 \
+    -o ${JBANG_PATH}/CamelJBang.java && \
+    sed -E -i \
+        
"s/\\$\\{camel\\.jbang\\.version:[^}]+\\}/\\\${camel.jbang.version:${CAMEL_VERSION}}/g;
 \
+        
s/\\$\\{camel-kamelets\\.version:[^}]+\\}/\\\${camel-kamelets.version:${CAMEL_VERSION}}/g"
 \
+        ${JBANG_PATH}/CamelJBang.java
+RUN echo '#!/bin/sh\nexec jbang run ${JBANG_PATH}/CamelJBang.java "$@"' > 
$JBANG_PATH/camel && \
     chmod +x $JBANG_PATH/camel && \
     mkdir -p $HOME/.jbang/cache && echo -n $JBANG_VERSION > 
$HOME/.jbang/cache/version.txt && \
     jbang trust add https://github.com/apache/camel && \
diff --git a/dsl/camel-jbang/camel-jbang-container/readme.adoc 
b/dsl/camel-jbang/camel-jbang-container/readme.adoc
new file mode 100644
index 000000000000..b29849681cbe
--- /dev/null
+++ b/dsl/camel-jbang/camel-jbang-container/readme.adoc
@@ -0,0 +1,60 @@
+= Camel JBang container release process
+
+This folder contains all the scripts required to run the release process for 
Camel JBang containers. It is performed via `Makefile` which contains the 
configuration variable for each release version.
+
+The process is in charge to build, publish and verify images for the JVM and 
architectures provided in the configuration, for example:
+
+```
+JDK_VERSIONS = 17-jdk 21-jdk
+ARCH_VERSIONS = amd64 arm64
+```
+
+It also set the default container image for `amd64` architecture and the JDK 
defined in `OFFICIAL_IMAGE_VERSION` configuration variable.
+
+The process can be run from `main` branch as it is in charge to checkout the 
proper release tag version as part of the execution script.
+
+== Docker Hub staging setting
+
+The default configuration is set to publish on 
https://hub.docker.com/orgs/apache/repositories[Apache Docker Hub organization]
+
+If you want to perform a staging release, you need to change the `IMAGE_NAME 
?= docker.io/apache/camel-jbang` to any other organization where you have 
privileges to push images.
+
+== Software required to release
+
+In order to release Camel JBang you may need certain software installed in the 
machine from where you're performing the release action. Most of the actions 
are scripted and may assume the presence of tools (in some case with specific 
version). Here a best effort list (may not be fully accurate):
+
+* Docker and DockerX tooling
+* https://www.qemu.org/[QEMU] - required to emulate ARM64 build
+
+=== Verify if your machine can build an ARM64 container image
+
+As suggested above, you may need to install some software to be able to build 
an ARM64 based image. You can verify that with:
+
+```
+docker buildx ls | grep arm
+```
+
+NOTE: if you don't list any available builder, if you're on Ubuntu, you can 
install quickly QEMU via `sudo apt-get install -y qemu qemu-user-static` and 
retry to list the ARM64 based builders afterward.
+
+== Stage images
+
+In order to perform a staging release, run:
+
+```
+IMAGE_NAME=<my-org>/camel-jbang CAMEL_VERSION=<tagged-camel-release> make 
images-release
+# IMAGE_NAME=squakez/camel-jbang CAMEL_VERSION=4.20.0 make images-release
+```
+
+The process is in charge to build, push and also verify (just checking `camel 
version` return the expected version) each container image released. It also 
run the `arm64` or any other architecture provided in the configuration.
+
+== Official release
+
+In order to perform an official release, run:
+
+```
+CAMEL_VERSION=4.20.0 make images-release
+```
+
+Make sure you're authenticated to docker hub and have an authorized user to 
push on Apache organization.
+
+The setting of `CAMEL_VERSION` variable is required to be provided by user 
input in order to make sure that this is always executed on an existing Camel 
release (the release tag `camel-a.b.x` must be available on github).
diff --git a/pom.xml b/pom.xml
index a03b84485ec6..7b0591aee479 100644
--- a/pom.xml
+++ b/pom.xml
@@ -393,6 +393,7 @@
                                     <exclude>**/examples/**/*</exclude>
                                     <exclude>**/*.wav</exclude>
                                     <exclude>**/*.cast</exclude>
+                                    <exclude>**/Makefile</exclude>
                                 </excludes>
                             </licenseSet>
                         </licenseSets>

Reply via email to