From 38d8f0f5aca7f59761991e43a118ae67c3152fd5 Mon Sep 17 00:00:00 2001 From: pasant9 Date: Mon, 17 Apr 2023 11:20:20 +0530 Subject: [PATCH] Modify APIM Docker Images to use base OS image and build Temurin OpenJDK --- dockerfiles/alpine/is-as-km/Dockerfile | 42 +++++++++++++++++-- dockerfiles/centos/is-as-km/Dockerfile | 46 +++++++++++++++++++-- dockerfiles/ubuntu/is-as-km/Dockerfile | 57 ++++++++++++++++++++++++-- 3 files changed, 136 insertions(+), 9 deletions(-) diff --git a/dockerfiles/alpine/is-as-km/Dockerfile b/dockerfiles/alpine/is-as-km/Dockerfile index 2013e990..730d385d 100755 --- a/dockerfiles/alpine/is-as-km/Dockerfile +++ b/dockerfiles/alpine/is-as-km/Dockerfile @@ -16,10 +16,46 @@ # # ------------------------------------------------------------------------ -# set base Docker image to AdoptOpenJDK Alpine Docker image -FROM adoptopenjdk/openjdk11:jdk-11.0.9_11-alpine +# set base Docker image to Alpine Docker image +FROM alpine:3.17.2 + +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' + +# install JDK Dependencies +RUN apk add --no-cache tzdata musl-locales musl-locales-lang \ + && rm -rf /var/cache/apk/* + +ENV JAVA_VERSION jdk-11.0.18+10 + +# install Temurin OpenJDK 11 +RUN set -eux; \ + ARCH="$(apk --print-arch)"; \ + case "${ARCH}" in \ + amd64|x86_64) \ + ESUM='42722bdbee99ad1430d6e88f17608909f26b57ab7761fb6b87ff4dbf6a8928bc'; \ + BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.18%2B10/OpenJDK11U-jdk_x64_alpine-linux_hotspot_11.0.18_10.tar.gz'; \ + ;; \ + *) \ + echo "Unsupported arch: ${ARCH}"; \ + exit 1; \ + ;; \ + esac; \ + wget -O /tmp/openjdk.tar.gz ${BINARY_URL}; \ + echo "${ESUM} */tmp/openjdk.tar.gz" | sha256sum -c -; \ + mkdir -p /opt/java/openjdk; \ + tar --extract \ + --file /tmp/openjdk.tar.gz \ + --directory /opt/java/openjdk \ + --strip-components 1 \ + --no-same-owner \ + ; \ + rm -rf /tmp/openjdk.tar.gz; + +ENV JAVA_HOME=/opt/java/openjdk \ + PATH="/opt/java/openjdk/bin:$PATH" + LABEL maintainer="WSO2 Docker Maintainers " \ - com.wso2.docker.source="https://github.com/wso2/docker-apim/releases/tag/v3.1.0.4" + com.wso2.docker.source="https://github.com/wso2/docker-apim/releases/tag/v3.1.0.7" # set Docker image build arguments # build arguments for user/group configurations diff --git a/dockerfiles/centos/is-as-km/Dockerfile b/dockerfiles/centos/is-as-km/Dockerfile index eb8866f2..a14969b7 100755 --- a/dockerfiles/centos/is-as-km/Dockerfile +++ b/dockerfiles/centos/is-as-km/Dockerfile @@ -16,10 +16,50 @@ # # ------------------------------------------------------------------------ -# set base Docker image to AdoptOpenJDK CentOS Docker image -FROM adoptopenjdk/openjdk11:jdk-11.0.9_11-centos +# set base Docker image to CentOS Docker image +FROM centos:7 + +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' + +# install JDK Dependencies +RUN yum install -y tzdata openssl curl ca-certificates fontconfig gzip tar \ + && yum clean all + +ENV JAVA_VERSION jdk-11.0.18+10 + +# install Temurin OpenJDK 11 +RUN set -eux; \ + ARCH="$(objdump="$(command -v objdump)" && objdump --file-headers "$objdump" | awk -F '[:,]+[[:space:]]+' '$1 == "architecture" { print $2 }')"; \ + case "${ARCH}" in \ + aarch64|arm64) \ + ESUM='04d5eeff6a6449bcdca0f52cd97bafd43ce09d40ef1e73fa0e1add63bea4a9c8'; \ + BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.18%2B10/OpenJDK11U-jdk_aarch64_linux_hotspot_11.0.18_10.tar.gz'; \ + ;; \ + ppc64el|powerpc:common64) \ + ESUM='459148d489b08ceec2d901e950ac36722b4c55e907e979291ddfc954ebdcea47'; \ + BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.18%2B10/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.18_10.tar.gz'; \ + ;; \ + amd64|i386:x86-64) \ + ESUM='4a29efda1d702b8ff38e554cf932051f40ec70006caed5c4857a8cbc7a0b7db7'; \ + BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.18%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.18_10.tar.gz'; \ + ;; \ + *) \ + echo "Unsupported arch: ${ARCH}"; \ + exit 1; \ + ;; \ + esac; \ + curl -LfsSo /tmp/openjdk.tar.gz ${BINARY_URL}; \ + echo "${ESUM} */tmp/openjdk.tar.gz" | sha256sum -c -; \ + mkdir -p /opt/java/openjdk; \ + cd /opt/java/openjdk; \ + tar -xf /tmp/openjdk.tar.gz --strip-components=1; \ + rm -rf /tmp/openjdk.tar.gz; + +ENV JAVA_HOME=/opt/java/openjdk \ + PATH="/opt/java/openjdk/bin:$PATH" + LABEL maintainer="WSO2 Docker Maintainers " \ - com.wso2.docker.source="https://github.com/wso2/docker-apim/releases/tag/v3.1.0.4" + com.wso2.docker.source="https://github.com/wso2/docker-apim/releases/tag/v3.1.0.7" # set Docker image build arguments # build arguments for user/group configurations diff --git a/dockerfiles/ubuntu/is-as-km/Dockerfile b/dockerfiles/ubuntu/is-as-km/Dockerfile index 809ac88a..b3e10419 100755 --- a/dockerfiles/ubuntu/is-as-km/Dockerfile +++ b/dockerfiles/ubuntu/is-as-km/Dockerfile @@ -16,10 +16,61 @@ # # ------------------------------------------------------------------------ -# set base Docker image to AdoptOpenJDK Ubuntu Docker image -FROM adoptopenjdk:11.0.9_11-jdk-hotspot-focal +# set base Docker image to Ubuntu Docker image +FROM ubuntu:22.04 + +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' + +# install JDK Dependencies +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata curl ca-certificates fontconfig locales python-is-python3 \ + && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \ + && locale-gen en_US.UTF-8 \ + && rm -rf /var/lib/apt/lists/* + +ENV JAVA_VERSION jdk-11.0.18+10 + +# install Temurin OpenJDK 11 +RUN set -eux; \ + ARCH="$(dpkg --print-architecture)"; \ + case "${ARCH}" in \ + aarch64|arm64) \ + ESUM='04d5eeff6a6449bcdca0f52cd97bafd43ce09d40ef1e73fa0e1add63bea4a9c8'; \ + BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.18%2B10/OpenJDK11U-jdk_aarch64_linux_hotspot_11.0.18_10.tar.gz'; \ + ;; \ + armhf|arm) \ + ESUM='b42840ef88621f87a4b49ae3a8db23dbf07cd9e7fb62823318709a592f597ea3'; \ + BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.18%2B10/OpenJDK11U-jdk_arm_linux_hotspot_11.0.18_10.tar.gz'; \ + ;; \ + ppc64el|powerpc:common64) \ + ESUM='459148d489b08ceec2d901e950ac36722b4c55e907e979291ddfc954ebdcea47'; \ + BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.18%2B10/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.18_10.tar.gz'; \ + ;; \ + s390x|s390:64-bit) \ + ESUM='7a7193c8279dd889c0a39296bcbae8866d94cff7a6d1bdfe676ffe4ced018915'; \ + BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.18%2B10/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.18_10.tar.gz'; \ + ;; \ + amd64|i386:x86-64) \ + ESUM='4a29efda1d702b8ff38e554cf932051f40ec70006caed5c4857a8cbc7a0b7db7'; \ + BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.18%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.18_10.tar.gz'; \ + ;; \ + *) \ + echo "Unsupported arch: ${ARCH}"; \ + exit 1; \ + ;; \ + esac; \ + curl -LfsSo /tmp/openjdk.tar.gz ${BINARY_URL}; \ + echo "${ESUM} */tmp/openjdk.tar.gz" | sha256sum -c -; \ + mkdir -p /opt/java/openjdk; \ + cd /opt/java/openjdk; \ + tar -xf /tmp/openjdk.tar.gz --strip-components=1; \ + rm -rf /tmp/openjdk.tar.gz; + +ENV JAVA_HOME=/opt/java/openjdk \ + PATH="/opt/java/openjdk/bin:$PATH" + LABEL maintainer="WSO2 Docker Maintainers " \ - com.wso2.docker.source="https://github.com/wso2/docker-apim/releases/tag/v3.1.0.4" + com.wso2.docker.source="https://github.com/wso2/docker-apim/releases/tag/v3.1.0.7" # set Docker image build arguments # build arguments for user/group configurations