From 7e29067e8e99199e42bed1003c4d51ec15a14be3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vilius=20=C5=A0umskas?= Date: Sun, 18 Sep 2022 21:43:22 +0300 Subject: [PATCH] ARTEMIS-3983 Update all base images to use Eclipse-Temurin --- ...ockerfile-centos => Dockerfile-centos7-11} | 4 +- ...Dockerfile-debian => Dockerfile-ubuntu-11} | 2 +- ...se-temurin-11 => Dockerfile-ubuntu-11-jre} | 0 artemis-docker/prepare-docker.sh | 21 +++--- artemis-docker/readme.md | 74 +++++++++---------- 5 files changed, 49 insertions(+), 52 deletions(-) rename artemis-docker/{Dockerfile-centos => Dockerfile-centos7-11} (97%) rename artemis-docker/{Dockerfile-debian => Dockerfile-ubuntu-11} (98%) rename artemis-docker/{Dockerfile-eclipse-temurin-11 => Dockerfile-ubuntu-11-jre} (100%) diff --git a/artemis-docker/Dockerfile-centos b/artemis-docker/Dockerfile-centos7-11 similarity index 97% rename from artemis-docker/Dockerfile-centos rename to artemis-docker/Dockerfile-centos7-11 index b6fe8f092f..5c8fb723da 100644 --- a/artemis-docker/Dockerfile-centos +++ b/artemis-docker/Dockerfile-centos7-11 @@ -17,7 +17,7 @@ # ActiveMQ Artemis -FROM jboss/base-jdk:11 +FROM eclipse-temurin:11-centos7 LABEL maintainer="Apache ActiveMQ Team" # Make sure pipes are considered to determine success, see: https://github.com/hadolint/hadolint/wiki/DL4006 SHELL ["/bin/bash", "-o", "pipefail", "-c"] @@ -66,4 +66,4 @@ VOLUME ["/var/lib/artemis-instance"] WORKDIR /var/lib/artemis-instance ENTRYPOINT ["/docker-run.sh"] -CMD ["run"] \ No newline at end of file +CMD ["run"] diff --git a/artemis-docker/Dockerfile-debian b/artemis-docker/Dockerfile-ubuntu-11 similarity index 98% rename from artemis-docker/Dockerfile-debian rename to artemis-docker/Dockerfile-ubuntu-11 index 263dbb3a98..71145cd937 100644 --- a/artemis-docker/Dockerfile-debian +++ b/artemis-docker/Dockerfile-ubuntu-11 @@ -17,7 +17,7 @@ # ActiveMQ Artemis -FROM openjdk:11 +FROM eclipse-temurin:11 LABEL maintainer="Apache ActiveMQ Team" # Make sure pipes are considered to determine success, see: https://github.com/hadolint/hadolint/wiki/DL4006 SHELL ["/bin/bash", "-o", "pipefail", "-c"] diff --git a/artemis-docker/Dockerfile-eclipse-temurin-11 b/artemis-docker/Dockerfile-ubuntu-11-jre similarity index 100% rename from artemis-docker/Dockerfile-eclipse-temurin-11 rename to artemis-docker/Dockerfile-ubuntu-11-jre diff --git a/artemis-docker/prepare-docker.sh b/artemis-docker/prepare-docker.sh index 8aa85e2f1a..63a6dcaf17 100755 --- a/artemis-docker/prepare-docker.sh +++ b/artemis-docker/prepare-docker.sh @@ -53,22 +53,21 @@ Well done! Now you can continue with building the Docker image: # Go to $ARTEMIS_DIST_DIR $ cd $ARTEMIS_DIST_DIR - # For Debian - $ docker build -f ./docker/Dockerfile-debian -t artemis-debian . - # For CentOS - $ docker build -f ./docker/Dockerfile-centos -t artemis-centos . + $ docker build -f ./docker/Dockerfile-centos7-11 -t artemis-centos . - # For AdoptOpen JDK 11 - $ docker build -f ./docker/Dockerfile-eclipse-temurin-11 -t artemis-eclipse-temurin-11 . + # For Ubuntu + $ docker build -f ./docker/Dockerfile-ubuntu-11 -t artemis-ubuntu . - # For AdoptOpen JDK 11 (Build for linux ARMv7/ARM64) - $ docker buildx build --platform linux/arm64,linux/arm/v7 --push -t {your-repository}/apache-artemis:2.17.0-SNAPSHOT -f ./docker/Dockerfile-eclipse-temurin-11 . + # Smaller Ubuntu image with just JRE + $ docker build -f ./docker/Dockerfile-ubuntu-11-jre -t artemis-ubuntu . -Note: -t artemis-debian, -t artemis-centos and artemis-eclipse-temurin-11 are just -tag names for the purpose of this guide + # For Ubuntu (Build for linux ARMv7/ARM64) + $ docker buildx build --platform linux/arm64,linux/arm/v7 --push -t {your-repository}/apache-artemis:2.17.0-SNAPSHOT -f ./docker/Dockerfile-ubuntu-11 . -For more info see readme.md +Note: -t artemis-centos and -t artemis-ubuntu are just tag names for the purpose of this guide + +For more info read the readme.md HERE exit 0 diff --git a/artemis-docker/readme.md b/artemis-docker/readme.md index 7799bd4838..707c46bcd8 100644 --- a/artemis-docker/readme.md +++ b/artemis-docker/readme.md @@ -1,7 +1,7 @@ # Docker Image Example This is an example on how you could create your own Docker Image For Apache -ActiveMQ Artemis based on CentOS or Debian (JDK 8) or AdoptOpen JDK 11 (Ubuntu). +ActiveMQ Artemis based on CentOS or Ubuntu (Eclipse Temurin JDK images). # Preparing @@ -10,6 +10,7 @@ binary distribution. Below is shown the command to prepare the build of the Docker Image starting from the local distribution (from the source codes of ActiveMQ Artemis) + ``` # Prepare for build the Docker Image from the local distribution. Replace the # {local-distribution-directory} with your directory. @@ -25,9 +26,9 @@ Using Artemis dist: ../artemis-distribution/target/apache-artemis-2.17.0-SNAPSHO Clean up the ../artemis-distribution/target/apache-artemis-2.17.0-SNAPSHOT-bin/apache-artemis-2.17.0-SNAPSHOT/docker directory Docker file support files at : ../artemis-distribution/target/apache-artemis-2.17.0-SNAPSHOT-bin/apache-artemis-2.17.0-SNAPSHOT/docker ../artemis-distribution/target/apache-artemis-2.17.0-SNAPSHOT-bin/apache-artemis-2.17.0-SNAPSHOT/docker -├── Dockerfile-eclipse-temurin-11 -├── Dockerfile-centos -├── Dockerfile-debian +├── Dockerfile-centos7-11 +├── Dockerfile-ubuntu-11 +├── Dockerfile-ubuntu-11-jre └── docker-run.sh 0 directories, 4 files @@ -39,24 +40,23 @@ Building the Docker Image: # Go to ../artemis-distribution/target/apache-artemis-2.17.0-SNAPSHOT-bin/apache-artemis-2.17.0-SNAPSHOT $ cd ../artemis-distribution/target/apache-artemis-2.17.0-SNAPSHOT-bin/apache-artemis-2.17.0-SNAPSHOT - # For Debian - $ docker build -f ./docker/Dockerfile-debian -t artemis-debian . - # For CentOS - $ docker build -f ./docker/Dockerfile-centos -t artemis-centos . + $ docker build -f ./docker/Dockerfile-centos7-11 -t artemis-centos . - # For AdoptOpen JDK 11 - $ docker build -f ./docker/Dockerfile-eclipse-temurin-11 -t artemis-eclipse-temurin-11 . + # For Ubuntu + $ docker build -f ./docker/Dockerfile-ubuntu-11 -t artemis-ubuntu . -Note: -t artemis-debian, -t artemis-centos and artemis-eclipse-temurin-11 are just -tag names for the purpose of this guide + # Smaller Ubuntu image with just JRE + $ docker build -f ./docker/Dockerfile-ubuntu-11-jre -t artemis-ubuntu . + +Note: -t artemis-centos and -t artemis-ubuntu are just tag names for the purpose of this guide For more info read the readme.md - ``` The command to prepare the build of the Docker Image starting from the official release of ActiveMQ Artemis is shown below + ``` # Prepare for build the Docker Image from the release version. Replace the # {release-version} with the version that you want @@ -75,9 +75,9 @@ Removing _TMP_/artemis/2.16.0/apache-artemis-2.16.0-bin.tar.gz... Using Artemis dist: _TMP_/artemis/2.16.0 Docker file support files at : _TMP_/artemis/2.16.0/docker _TMP_/artemis/2.16.0/docker -├── Dockerfile-eclipse-temurin-11 -├── Dockerfile-centos -├── Dockerfile-debian +├── Dockerfile-centos7-11 +├── Dockerfile-ubuntu-11 +├── Dockerfile-ubuntu-11-jre └── docker-run.sh 0 directories, 4 files @@ -89,17 +89,16 @@ Building the Docker Image: # Go to _TMP_/artemis/2.16.0 $ cd _TMP_/artemis/2.16.0 - # For Debian - $ docker build -f ./docker/Dockerfile-debian -t artemis-debian . - # For CentOS - $ docker build -f ./docker/Dockerfile-centos -t artemis-centos . + $ docker build -f ./docker/Dockerfile-centos7-11 -t artemis-centos . - # For AdoptOpen JDK 11 - $ docker build -f ./docker/Dockerfile-eclipse-temurin-11 -t artemis-eclipse-temurin-11 . + # For Ubuntu + $ docker build -f ./docker/Dockerfile-ubuntu-11 -t artemis-ubuntu . -Note: -t artemis-debian, -t artemis-centos and artemis-eclipse-temurin-11 are just -tag names for the purpose of this guide + # Smaller Ubuntu image with just JRE + $ docker build -f ./docker/Dockerfile-ubuntu-11-jre -t artemis-ubuntu . + +Note: -t artemis-centos and -t artemis-ubuntu are just tag names for the purpose of this guide For more info read the readme.md ``` @@ -108,34 +107,33 @@ For more info read the readme.md Go to `$ARTEMIS_DIST` where you prepared the binary with Docker files. -## For Debian - -From within the `$ARTEMIS_DIST` folder: -``` -$ docker build -f ./docker/Dockerfile-debian -t artemis-debian . -``` - ## For CentOS From within the `$ARTEMIS_DIST` folder: ``` -$ docker build -f ./docker/Dockerfile-centos -t artemis-centos . +$ docker build -f ./docker/Dockerfile-centos7-11 -t artemis-centos . ``` -## For AdoptOpen JDK 11 +## For Ubuntu + From within the `$ARTEMIS_DIST` folder: ``` -$ docker build -f ./docker/Dockerfile-eclipse-temurin-11 -t artemis-eclipse-temurin-11 . +$ docker build -f ./docker/Dockerfile-ubuntu-11 -t artemis-ubuntu . ``` -# For AdoptOpen JDK 11 (Build for linux ARMv7/ARM64) +## Smaller Ubuntu image with just JRE +From within the `$ARTEMIS_DIST` folder: ``` -$ docker buildx build --platform linux/arm64,linux/arm/v7 --push -t {your-repository}/apache-artemis:2.17.0-SNAPSHOT -f ./docker/Dockerfile-eclipse-temurin-11 . +$ docker build -f ./docker/Dockerfile-ubuntu-11-jre -t artemis-ubuntu . +``` + +# For Ubuntu (Build for linux ARMv7/ARM64) +``` +$ docker buildx build --platform linux/arm64,linux/arm/v7 --push -t {your-repository}/apache-artemis:2.17.0-SNAPSHOT -f ./docker/Dockerfile-ubuntu-11 . ``` **Note:** -`-t artemis-debian`,`-t artemis-centos`,`artemis-eclipse-temurin-11` are just tag -names for the purpose of this guide +`-t artemis-centos` and `-t artemis-ubuntu` are just tag names for the purpose of this guide # Environment Variables