From d461e7319398e1e43fbeada147bac13dab225108 Mon Sep 17 00:00:00 2001 From: Pasan Tennakoon Date: Thu, 10 Feb 2022 15:34:48 +0530 Subject: [PATCH 1/2] Modify APIM Docker Images to use base OS image and build Temurin OpenJDK --- dockerfiles/alpine/apim/Dockerfile | 46 +++++++++++++++++++++- dockerfiles/centos/apim/Dockerfile | 50 +++++++++++++++++++++++- dockerfiles/ubuntu/apim/Dockerfile | 61 +++++++++++++++++++++++++++++- 3 files changed, 151 insertions(+), 6 deletions(-) diff --git a/dockerfiles/alpine/apim/Dockerfile b/dockerfiles/alpine/apim/Dockerfile index 2fecf9cd..892965db 100755 --- a/dockerfiles/alpine/apim/Dockerfile +++ b/dockerfiles/alpine/apim/Dockerfile @@ -16,8 +16,50 @@ # # ------------------------------------------------------------------------ -# 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.15 + +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.14+9 + +# install OpenJDK 11 +RUN set -eux; \ + ARCH="$(apk --print-arch)"; \ + case "${ARCH}" in \ + amd64|x86_64) \ + ESUM='f94a01258a5496eda9e3de6807e6ecfe08a5ad4a2d42e4332a77f74174706f5c'; \ + BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.14%2B9/OpenJDK11U-jdk_x64_alpine-linux_hotspot_11.0.14_9.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" + +# Verify Java installation +RUN echo Verifying install ... \ + && echo javac --version && javac --version \ + && echo java --version && java --version \ + && echo Complete. + LABEL maintainer="WSO2 Docker Maintainers " \ com.wso2.docker.source="https://github.com/wso2/docker-apim/releases/tag/v3.1.0.4" diff --git a/dockerfiles/centos/apim/Dockerfile b/dockerfiles/centos/apim/Dockerfile index 6078d3a5..c07e5b5d 100755 --- a/dockerfiles/centos/apim/Dockerfile +++ b/dockerfiles/centos/apim/Dockerfile @@ -16,8 +16,54 @@ # # ------------------------------------------------------------------------ -# 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.14+9 + +# install 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='0ba188a2a739733163cd0049344429d2284867e04ca452879be24f3b54320c9a'; \ + BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.14%2B9/OpenJDK11U-jdk_aarch64_linux_hotspot_11.0.14_9.tar.gz'; \ + ;; \ + ppc64el|powerpc:common64) \ + ESUM='91c63331faba8c842aef312d415b3e67aecf4f662a36c275f5cb278f7bce1410'; \ + BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.14%2B9/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.14_9.tar.gz'; \ + ;; \ + amd64|i386:x86-64) \ + ESUM='1189bee178d11402a690edf3fbba0c9f2ada1d3a36ff78929d81935842ef24a9'; \ + BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.14%2B9/OpenJDK11U-jdk_x64_linux_hotspot_11.0.14_9.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" + +# Verify Java installation +RUN echo Verifying install ... \ + && echo javac --version && javac --version \ + && echo java --version && java --version \ + && echo Complete. + LABEL maintainer="WSO2 Docker Maintainers " \ com.wso2.docker.source="https://github.com/wso2/docker-apim/releases/tag/v3.1.0.4" diff --git a/dockerfiles/ubuntu/apim/Dockerfile b/dockerfiles/ubuntu/apim/Dockerfile index 33047fbc..dbd099f5 100755 --- a/dockerfiles/ubuntu/apim/Dockerfile +++ b/dockerfiles/ubuntu/apim/Dockerfile @@ -16,8 +16,65 @@ # # ------------------------------------------------------------------------ -# set base Docker image to AdoptOpenJDK Ubuntu Docker image -FROM adoptopenjdk:11.0.9_11-jdk-hotspot-focal +# set base Docker image to Ubuntu Focal Docker image +FROM ubuntu:20.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.14+9 + +# install OpenJDK 11 +RUN set -eux; \ + ARCH="$(dpkg --print-architecture)"; \ + case "${ARCH}" in \ + aarch64|arm64) \ + ESUM='0ba188a2a739733163cd0049344429d2284867e04ca452879be24f3b54320c9a'; \ + BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.14%2B9/OpenJDK11U-jdk_aarch64_linux_hotspot_11.0.14_9.tar.gz'; \ + ;; \ + armhf|arm) \ + ESUM='a0ba2fa6a982fe6c09c721ac9c72c8e5323991a529403daacac323549df4495d'; \ + BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.14%2B9/OpenJDK11U-jdk_arm_linux_hotspot_11.0.14_9.tar.gz'; \ + ;; \ + ppc64el|powerpc:common64) \ + ESUM='91c63331faba8c842aef312d415b3e67aecf4f662a36c275f5cb278f7bce1410'; \ + BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.14%2B9/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.14_9.tar.gz'; \ + ;; \ + s390x|s390:64-bit) \ + ESUM='4dd43e06830e62d65c698b393db10bab39ec6575de08db8d2f5b66cfe09c8c85'; \ + BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.14%2B9/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.14_9.tar.gz'; \ + ;; \ + amd64|i386:x86-64) \ + ESUM='1189bee178d11402a690edf3fbba0c9f2ada1d3a36ff78929d81935842ef24a9'; \ + BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.14%2B9/OpenJDK11U-jdk_x64_linux_hotspot_11.0.14_9.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" + +# Verify Java installation +RUN echo Verifying install ... \ + && echo javac --version && javac --version \ + && echo java --version && java --version \ + && echo Complete. + LABEL maintainer="WSO2 Docker Maintainers " \ com.wso2.docker.source="https://github.com/wso2/docker-apim/releases/tag/v3.1.0.4" From ed2ee95fb3f80e30fc5df0746b35d3aa8331fe5f Mon Sep 17 00:00:00 2001 From: Pasan Tennakoon Date: Wed, 2 Mar 2022 22:13:43 +0530 Subject: [PATCH 2/2] Change maintainers label tag --- dockerfiles/alpine/apim/Dockerfile | 2 +- dockerfiles/centos/apim/Dockerfile | 2 +- dockerfiles/ubuntu/apim/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dockerfiles/alpine/apim/Dockerfile b/dockerfiles/alpine/apim/Dockerfile index 892965db..a059443c 100755 --- a/dockerfiles/alpine/apim/Dockerfile +++ b/dockerfiles/alpine/apim/Dockerfile @@ -61,7 +61,7 @@ RUN echo Verifying install ... \ && echo Complete. 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.5" # set Docker image build arguments # build arguments for user/group configurations diff --git a/dockerfiles/centos/apim/Dockerfile b/dockerfiles/centos/apim/Dockerfile index c07e5b5d..9baaa72c 100755 --- a/dockerfiles/centos/apim/Dockerfile +++ b/dockerfiles/centos/apim/Dockerfile @@ -65,7 +65,7 @@ RUN echo Verifying install ... \ && echo Complete. 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.5" # set Docker image build arguments # build arguments for user/group configurations diff --git a/dockerfiles/ubuntu/apim/Dockerfile b/dockerfiles/ubuntu/apim/Dockerfile index dbd099f5..0f75be32 100755 --- a/dockerfiles/ubuntu/apim/Dockerfile +++ b/dockerfiles/ubuntu/apim/Dockerfile @@ -76,7 +76,7 @@ RUN echo Verifying install ... \ && echo Complete. 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.5" # set Docker image build arguments # build arguments for user/group configurations