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

apupier 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 7584017fddc CAMEL-20608 - Improve Docker image for JBang
7584017fddc is described below

commit 7584017fddc2e20cc99ecd9437d1ca9316e538d8
Author: AurĂ©lien Pupier <[email protected]>
AuthorDate: Thu Jun 6 16:39:21 2024 +0200

    CAMEL-20608 - Improve Docker image for JBang
    
    - Use specific image instead of jbang-action image which was initially
    designed for GitHub actions which is not actively maintained as
    jabg-action is no more the recommended way
    - Use JDK 21
    - Added a line to warm up the dependencies which is drastically reduce
    the time to execute the docker image
    
    Signed-off-by: AurĂ©lien Pupier <[email protected]>
---
 dsl/camel-jbang/camel-jbang-container/Dockerfile | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/dsl/camel-jbang/camel-jbang-container/Dockerfile 
b/dsl/camel-jbang/camel-jbang-container/Dockerfile
index c9c0b924331..84f458a2277 100644
--- a/dsl/camel-jbang/camel-jbang-container/Dockerfile
+++ b/dsl/camel-jbang/camel-jbang-container/Dockerfile
@@ -15,9 +15,21 @@
 # limitations under the License.
 #
 
-FROM docker.io/jbangdev/jbang-action
+FROM docker.io/eclipse-temurin:21-jdk
+
+ENV JBANG_VERSION=0.116.0
+# /!\ Camel version must be changed in the entrypoint line too
+ENV CAMEL_VERSION=4.6.0 
+
+RUN wget -c 
https://github.com/jbangdev/jbang/releases/download/v$JBANG_VERSION/jbang.tar 
-O - | tar xv && \
+    chmod +x jbang/bin/jbang
+ENV PATH="${PATH}:/jbang/bin"
+ENV JBANG_PATH=/jbang/bin
 
 RUN jbang trust add https://github.com/apache/camel
+
+# used to initiliaze dependencies in the docker image
+RUN jbang -Dcamel.jbang.version=$CAMEL_VERSION camel@apache/camel version
     
-ENTRYPOINT [ "jbang",  "-Dcamel.jbang.version=4.6.0", "camel@apache/camel"]
+ENTRYPOINT [ "jbang", "-Dcamel.jbang.version=4.6.0", "camel@apache/camel"]
 

Reply via email to