This is an automated email from the ASF dual-hosted git repository. jamesnetherton pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-quarkus-examples.git
commit 87f87fddef9196ce0e9f536f9e84b43a2d99357b Author: James Netherton <[email protected]> AuthorDate: Tue Feb 17 14:26:32 2026 +0000 Add refresh-dockerfiles script to keep example project Dockerfiles updated --- aws-lambda/src/main/docker/Dockerfile.jvm | 6 +- aws-lambda/src/main/docker/Dockerfile.legacy-jar | 6 +- aws-lambda/src/main/docker/Dockerfile.native | 6 +- aws-lambda/src/main/docker/Dockerfile.native-micro | 2 +- fhir/src/main/docker/Dockerfile.jvm | 6 +- fhir/src/main/docker/Dockerfile.legacy-jar | 6 +- fhir/src/main/docker/Dockerfile.native | 6 +- fhir/src/main/docker/Dockerfile.native-micro | 2 +- kafka/src/main/docker/Dockerfile.jvm | 6 +- kafka/src/main/docker/Dockerfile.legacy-jar | 6 +- kafka/src/main/docker/Dockerfile.native | 6 +- kafka/src/main/docker/Dockerfile.native-micro | 2 +- refresh-dockerfiles.sh | 95 ++++++++++++++++++++++ 13 files changed, 131 insertions(+), 24 deletions(-) diff --git a/aws-lambda/src/main/docker/Dockerfile.jvm b/aws-lambda/src/main/docker/Dockerfile.jvm index 8165742f..63b0796f 100644 --- a/aws-lambda/src/main/docker/Dockerfile.jvm +++ b/aws-lambda/src/main/docker/Dockerfile.jvm @@ -19,7 +19,7 @@ # # Before building the container image run: # -# mvn package +# ./mvnw package # # Then, build the image with: # @@ -93,8 +93,10 @@ # - NO_PROXY: A comma separated lists of hosts, IP addresses or domains that can be # accessed directly. (example: "foo.example.com,bar.example.com") # +# You can find more information about the UBI base runtime images and their configuration here: +# https://rh-openjdk.github.io/redhat-openjdk-containers/ ### -FROM registry.access.redhat.com/ubi9/openjdk-21:1.21 +FROM registry.access.redhat.com/ubi9/openjdk-21-runtime:1.24 ENV LANGUAGE='en_US:en' diff --git a/aws-lambda/src/main/docker/Dockerfile.legacy-jar b/aws-lambda/src/main/docker/Dockerfile.legacy-jar index 8c5ab762..ef931e72 100644 --- a/aws-lambda/src/main/docker/Dockerfile.legacy-jar +++ b/aws-lambda/src/main/docker/Dockerfile.legacy-jar @@ -19,7 +19,7 @@ # # Before building the container image run: # -# mvn package -Dquarkus.package.jar.type=legacy-jar +# ./mvnw package -Dquarkus.package.jar.type=legacy-jar # # Then, build the image with: # @@ -93,8 +93,10 @@ # - NO_PROXY: A comma separated lists of hosts, IP addresses or domains that can be # accessed directly. (example: "foo.example.com,bar.example.com") # +# You can find more information about the UBI base runtime images and their configuration here: +# https://rh-openjdk.github.io/redhat-openjdk-containers/ ### -FROM registry.access.redhat.com/ubi9/openjdk-21:1.21 +FROM registry.access.redhat.com/ubi9/openjdk-21-runtime:1.24 ENV LANGUAGE='en_US:en' diff --git a/aws-lambda/src/main/docker/Dockerfile.native b/aws-lambda/src/main/docker/Dockerfile.native index ef779c02..01949cca 100644 --- a/aws-lambda/src/main/docker/Dockerfile.native +++ b/aws-lambda/src/main/docker/Dockerfile.native @@ -19,7 +19,7 @@ # # Before building the container image run: # -# mvn package -Dnative +# ./mvnw package -Dnative # # Then, build the image with: # @@ -29,10 +29,10 @@ # # docker run -i --rm -p 8080:8080 quarkus/aws-lambda # -# The ` registry.access.redhat.com/ubi9/ubi-minimal:9.5` base image is based on UBI 9. +# The ` registry.access.redhat.com/ubi9/ubi-minimal:9.7` base image is based on UBI 9. # To use UBI 8, switch to `quay.io/ubi8/ubi-minimal:8.10`. ### -FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5 +FROM registry.access.redhat.com/ubi9/ubi-minimal:9.7 WORKDIR /work/ RUN chown 1001 /work \ && chmod "g+rwX" /work \ diff --git a/aws-lambda/src/main/docker/Dockerfile.native-micro b/aws-lambda/src/main/docker/Dockerfile.native-micro index f63523a1..cfe98de3 100644 --- a/aws-lambda/src/main/docker/Dockerfile.native-micro +++ b/aws-lambda/src/main/docker/Dockerfile.native-micro @@ -22,7 +22,7 @@ # # Before building the container image run: # -# mvn package -Dnative +# ./mvnw package -Dnative # # Then, build the image with: # diff --git a/fhir/src/main/docker/Dockerfile.jvm b/fhir/src/main/docker/Dockerfile.jvm index b8e329e9..97e8d927 100644 --- a/fhir/src/main/docker/Dockerfile.jvm +++ b/fhir/src/main/docker/Dockerfile.jvm @@ -19,7 +19,7 @@ # # Before building the container image run: # -# mvn package +# ./mvnw package # # Then, build the image with: # @@ -93,8 +93,10 @@ # - NO_PROXY: A comma separated lists of hosts, IP addresses or domains that can be # accessed directly. (example: "foo.example.com,bar.example.com") # +# You can find more information about the UBI base runtime images and their configuration here: +# https://rh-openjdk.github.io/redhat-openjdk-containers/ ### -FROM registry.access.redhat.com/ubi9/openjdk-21:1.21 +FROM registry.access.redhat.com/ubi9/openjdk-21-runtime:1.24 ENV LANGUAGE='en_US:en' diff --git a/fhir/src/main/docker/Dockerfile.legacy-jar b/fhir/src/main/docker/Dockerfile.legacy-jar index 6cbc6ad3..a72c1c83 100644 --- a/fhir/src/main/docker/Dockerfile.legacy-jar +++ b/fhir/src/main/docker/Dockerfile.legacy-jar @@ -19,7 +19,7 @@ # # Before building the container image run: # -# mvn package -Dquarkus.package.jar.type=legacy-jar +# ./mvnw package -Dquarkus.package.jar.type=legacy-jar # # Then, build the image with: # @@ -93,8 +93,10 @@ # - NO_PROXY: A comma separated lists of hosts, IP addresses or domains that can be # accessed directly. (example: "foo.example.com,bar.example.com") # +# You can find more information about the UBI base runtime images and their configuration here: +# https://rh-openjdk.github.io/redhat-openjdk-containers/ ### -FROM registry.access.redhat.com/ubi9/openjdk-21:1.21 +FROM registry.access.redhat.com/ubi9/openjdk-21-runtime:1.24 ENV LANGUAGE='en_US:en' diff --git a/fhir/src/main/docker/Dockerfile.native b/fhir/src/main/docker/Dockerfile.native index cb9b84fa..612b95f8 100644 --- a/fhir/src/main/docker/Dockerfile.native +++ b/fhir/src/main/docker/Dockerfile.native @@ -19,7 +19,7 @@ # # Before building the container image run: # -# mvn package -Dnative +# ./mvnw package -Dnative # # Then, build the image with: # @@ -29,10 +29,10 @@ # # docker run -i --rm -p 8080:8080 quarkus/fhir # -# The ` registry.access.redhat.com/ubi9/ubi-minimal:9.5` base image is based on UBI 9. +# The ` registry.access.redhat.com/ubi9/ubi-minimal:9.7` base image is based on UBI 9. # To use UBI 8, switch to `quay.io/ubi8/ubi-minimal:8.10`. ### -FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5 +FROM registry.access.redhat.com/ubi9/ubi-minimal:9.7 WORKDIR /work/ RUN chown 1001 /work \ && chmod "g+rwX" /work \ diff --git a/fhir/src/main/docker/Dockerfile.native-micro b/fhir/src/main/docker/Dockerfile.native-micro index 971b1a70..d1439b19 100644 --- a/fhir/src/main/docker/Dockerfile.native-micro +++ b/fhir/src/main/docker/Dockerfile.native-micro @@ -22,7 +22,7 @@ # # Before building the container image run: # -# mvn package -Dnative +# ./mvnw package -Dnative # # Then, build the image with: # diff --git a/kafka/src/main/docker/Dockerfile.jvm b/kafka/src/main/docker/Dockerfile.jvm index 1ca1b90d..457c006d 100644 --- a/kafka/src/main/docker/Dockerfile.jvm +++ b/kafka/src/main/docker/Dockerfile.jvm @@ -19,7 +19,7 @@ # # Before building the container image run: # -# mvn package +# ./mvnw package # # Then, build the image with: # @@ -93,8 +93,10 @@ # - NO_PROXY: A comma separated lists of hosts, IP addresses or domains that can be # accessed directly. (example: "foo.example.com,bar.example.com") # +# You can find more information about the UBI base runtime images and their configuration here: +# https://rh-openjdk.github.io/redhat-openjdk-containers/ ### -FROM registry.access.redhat.com/ubi9/openjdk-21:1.21 +FROM registry.access.redhat.com/ubi9/openjdk-21-runtime:1.24 ENV LANGUAGE='en_US:en' diff --git a/kafka/src/main/docker/Dockerfile.legacy-jar b/kafka/src/main/docker/Dockerfile.legacy-jar index a5bcbcdf..439dfca3 100644 --- a/kafka/src/main/docker/Dockerfile.legacy-jar +++ b/kafka/src/main/docker/Dockerfile.legacy-jar @@ -19,7 +19,7 @@ # # Before building the container image run: # -# mvn package -Dquarkus.package.jar.type=legacy-jar +# ./mvnw package -Dquarkus.package.jar.type=legacy-jar # # Then, build the image with: # @@ -93,8 +93,10 @@ # - NO_PROXY: A comma separated lists of hosts, IP addresses or domains that can be # accessed directly. (example: "foo.example.com,bar.example.com") # +# You can find more information about the UBI base runtime images and their configuration here: +# https://rh-openjdk.github.io/redhat-openjdk-containers/ ### -FROM registry.access.redhat.com/ubi9/openjdk-21:1.21 +FROM registry.access.redhat.com/ubi9/openjdk-21-runtime:1.24 ENV LANGUAGE='en_US:en' diff --git a/kafka/src/main/docker/Dockerfile.native b/kafka/src/main/docker/Dockerfile.native index d5f0bc7f..c1c57ea7 100644 --- a/kafka/src/main/docker/Dockerfile.native +++ b/kafka/src/main/docker/Dockerfile.native @@ -19,7 +19,7 @@ # # Before building the container image run: # -# mvn package -Dnative +# ./mvnw package -Dnative # # Then, build the image with: # @@ -29,10 +29,10 @@ # # docker run -i --rm -p 8080:8080 quarkus/kafka # -# The ` registry.access.redhat.com/ubi9/ubi-minimal:9.5` base image is based on UBI 9. +# The ` registry.access.redhat.com/ubi9/ubi-minimal:9.7` base image is based on UBI 9. # To use UBI 8, switch to `quay.io/ubi8/ubi-minimal:8.10`. ### -FROM registry.access.redhat.com/ubi9/ubi-minimal:9.5 +FROM registry.access.redhat.com/ubi9/ubi-minimal:9.7 WORKDIR /work/ RUN chown 1001 /work \ && chmod "g+rwX" /work \ diff --git a/kafka/src/main/docker/Dockerfile.native-micro b/kafka/src/main/docker/Dockerfile.native-micro index 3740141f..4eaca651 100644 --- a/kafka/src/main/docker/Dockerfile.native-micro +++ b/kafka/src/main/docker/Dockerfile.native-micro @@ -22,7 +22,7 @@ # # Before building the container image run: # -# mvn package -Dnative +# ./mvnw package -Dnative # # Then, build the image with: # diff --git a/refresh-dockerfiles.sh b/refresh-dockerfiles.sh new file mode 100755 index 00000000..ac02dfe1 --- /dev/null +++ b/refresh-dockerfiles.sh @@ -0,0 +1,95 @@ +#!/bin/bash + +# 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. + +# This script refreshes the Dockerfiles in the examples by generating a temporary project +# using the Quarkus Maven plugin and copies the generated Dockerfiles. + +set -e + +PROJECT_ROOT=$(pwd) + +# Get Quarkus version properties from a reference example project pom.xml +QUARKUS_MAVEN_PLUGIN_VERSION=$("$PROJECT_ROOT/mvnw" -f timer-log/pom.xml help:evaluate -Dexpression=quarkus.platform.version -q -DforceStdout) +QUARKUS_MAVEN_PLUGIN_GROUP_ID=$("$PROJECT_ROOT/mvnw" -f timer-log/pom.xml help:evaluate -Dexpression=quarkus.platform.group-id -q -DforceStdout) +QUARKUS_MAVEN_PLUGIN_ARTIFACT_ID="quarkus-maven-plugin" + +if [ -z "$QUARKUS_MAVEN_PLUGIN_VERSION" ] || [ -z "$QUARKUS_MAVEN_PLUGIN_GROUP_ID" ] || [ -z "$QUARKUS_MAVEN_PLUGIN_ARTIFACT_ID" ]; then + echo "Error: Could not extract all Quarkus platform properties from timer-log/pom.xml" + exit 1 +fi + +echo "Detected Quarkus Maven Plugin Group ID: $QUARKUS_MAVEN_PLUGIN_GROUP_ID" +echo "Detected Quarkus Maven Plugin Artifact ID: $QUARKUS_MAVEN_PLUGIN_ARTIFACT_ID" +echo "Detected Quarkus Maven Plugin Version: $QUARKUS_MAVEN_PLUGIN_VERSION" + +TEMP_DIR=$(mktemp -d) +echo "Created temporary directory: $TEMP_DIR" + +cd "$TEMP_DIR" + +echo "Generating temporary Quarkus project with Quarkus Maven Plugin..." +"$PROJECT_ROOT/mvnw" "${QUARKUS_MAVEN_PLUGIN_GROUP_ID}:${QUARKUS_MAVEN_PLUGIN_ARTIFACT_ID}:${QUARKUS_MAVEN_PLUGIN_VERSION}:create" \ + -DprojectGroupId=org.acme \ + -DprojectArtifactId=temp-quarkus-project \ + -DnoCode=true \ + -Dextensions="resteasy-reactive" + +if [ $? -ne 0 ]; then + echo "Error: Quarkus project generation failed." + rm -rf "$TEMP_DIR" + exit 1 +fi + +GENERATED_DOCKER_DIR="$TEMP_DIR/temp-quarkus-project/src/main/docker" + +if [ ! -d "$GENERATED_DOCKER_DIR" ]; then + echo "Error: Generated Docker directory not found at $GENERATED_DOCKER_DIR" + rm -rf "$TEMP_DIR" + exit 1 +fi + +cd - + +echo "Updating Dockerfiles in example projects..." + +for EXAMPLE_DIR in */; do + if [ -d "$EXAMPLE_DIR" ] && [ "$EXAMPLE_DIR" != "docs/" ] && [ "$EXAMPLE_DIR" != ".git/" ] && [ "$EXAMPLE_DIR" != ".github/" ] && [ "$EXAMPLE_DIR" != ".idea/" ] && [ "$EXAMPLE_DIR" != ".mvn/" ]; then + TARGET_DOCKER_DIR="$EXAMPLE_DIR/src/main/docker" + if [ -d "$TARGET_DOCKER_DIR" ]; then + echo " - Updating Dockerfiles in $EXAMPLE_DIR" + rm -rf "$TARGET_DOCKER_DIR"/* + cp -r "$GENERATED_DOCKER_DIR"/* "$TARGET_DOCKER_DIR"/ + + PROJECT_NAME=$(basename "$EXAMPLE_DIR") + for DOCKERFILE in "$TARGET_DOCKER_DIR"/*; do + if [ -f "$DOCKERFILE" ]; then + echo " - Replacing 'temp-quarkus-project' with '$PROJECT_NAME' in $DOCKERFILE" + sed -i "" "s/temp-quarkus-project/$PROJECT_NAME/g" "$DOCKERFILE" + fi + done + echo " - Running mvn license:format in $EXAMPLE_DIR" + (cd "$EXAMPLE_DIR" && "$PROJECT_ROOT/mvnw" license:format) + else + echo " - Skipping $EXAMPLE_DIR: No src/main/docker directory found." + fi + fi +done + +echo "Cleaning up temporary directory: $TEMP_DIR" +rm -rf "$TEMP_DIR" + +echo "Dockerfile refresh complete." \ No newline at end of file
