From a3e7163c8424bb43341aafe092074971a08a0512 Mon Sep 17 00:00:00 2001 From: Yoshani Date: Tue, 31 Jan 2023 13:21:44 +0530 Subject: [PATCH 01/13] Modified Dockerfiles to have OS based base image and adoptium JDK 8 --- .../alpine/is-analytics/dashboard/Dockerfile | 61 +++++++++++++++-- .../alpine/is-analytics/worker/Dockerfile | 61 +++++++++++++++-- dockerfiles/alpine/is/Dockerfile | 66 +++++++++++++++++-- .../centos/is-analytics/dashboard/Dockerfile | 57 ++++++++++++---- .../centos/is-analytics/worker/Dockerfile | 57 ++++++++++++---- dockerfiles/centos/is/Dockerfile | 57 ++++++++++++---- .../ubuntu/is-analytics/dashboard/Dockerfile | 8 +-- .../ubuntu/is-analytics/worker/Dockerfile | 8 +-- dockerfiles/ubuntu/is/Dockerfile | 8 +-- 9 files changed, 316 insertions(+), 67 deletions(-) diff --git a/dockerfiles/alpine/is-analytics/dashboard/Dockerfile b/dockerfiles/alpine/is-analytics/dashboard/Dockerfile index be82a80d..654f602f 100644 --- a/dockerfiles/alpine/is-analytics/dashboard/Dockerfile +++ b/dockerfiles/alpine/is-analytics/dashboard/Dockerfile @@ -16,10 +16,58 @@ # # ------------------------------------------------------------------------ -# set base Docker image to AdoptOpenJDK Alpine Docker image -FROM adoptopenjdk/openjdk8:jdk8u302-b08-alpine +# Set base Docker image to Alpine Docker image. +FROM alpine:3.15.0 LABEL maintainer="WSO2 Docker Maintainers " \ - com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.0.7" + com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.1.0" +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 jdk8u362-b09 + +RUN apk --no-progress --purge --no-cache upgrade \ +&& apk --no-progress --purge --no-cache add --upgrade \ + curl \ + wget \ + openssh \ +&& apk --no-progress --purge --no-cache upgrade \ +&& rm -vrf /var/cache/apk/* \ +&& curl --version + +RUN curl -o /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \ +&& curl -LO https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.32-r0/glibc-2.32-r0.apk \ +&& apk add glibc-2.32-r0.apk + +#Install JDK8. +RUN set -eux; \ + apk add --no-cache --virtual .fetch-deps curl; \ + ARCH="$(apk --print-arch)"; \ + case "${ARCH}" in \ + amd64|x86_64) \ + ESUM='389c0d2ea59742103f46f1dd6d2c83e43e9f935f3f0485b1f9e74ac4e8c5ce47'; \ + BINARY_URL='https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u362-b09/OpenJDK8U-jdk_x64_alpine-linux_hotspot_8u362b09.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" ENV=${USER_HOME}"/.ashrc" # set Docker image build arguments # build arguments for user/group configurations @@ -31,6 +79,7 @@ ARG USER_HOME=/home/${USER} # build arguments for WSO2 product installation ARG WSO2_SERVER_NAME=wso2is-analytics ARG WSO2_SERVER_VERSION=5.8.0 +ARG WSO2_SERVER_REPOSITORY=product-is ARG WSO2_SERVER=${WSO2_SERVER_NAME}-${WSO2_SERVER_VERSION} ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER} ARG WSO2_SERVER_DIST_URL=https://bintray.com/wso2/binaryGA/download_file?file_path=${WSO2_SERVER}.zip @@ -54,7 +103,11 @@ RUN \ # copy init script to user home COPY --chown=wso2carbon:wso2 docker-entrypoint.sh ${USER_HOME}/ # install required packages -RUN apk add --no-cache netcat-openbsd +RUN \ + apk update \ + && apk add --no-cache netcat-openbsd \ + && apk add unzip \ + && apk add wget # add the WSO2 product distribution to user's home directory RUN \ wget -O ${WSO2_SERVER}.zip "${WSO2_SERVER_DIST_URL}" \ diff --git a/dockerfiles/alpine/is-analytics/worker/Dockerfile b/dockerfiles/alpine/is-analytics/worker/Dockerfile index ec716923..d1ec5b5b 100644 --- a/dockerfiles/alpine/is-analytics/worker/Dockerfile +++ b/dockerfiles/alpine/is-analytics/worker/Dockerfile @@ -16,10 +16,58 @@ # # ------------------------------------------------------------------------ -# set base Docker image to AdoptOpenJDK Alpine Docker image -FROM adoptopenjdk/openjdk8:jdk8u302-b08-alpine +# Set base Docker image to Alpine Docker image. +FROM alpine:3.15.0 LABEL maintainer="WSO2 Docker Maintainers " \ - com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.0.7" + com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.1.0" +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 jdk8u362-b09 + +RUN apk --no-progress --purge --no-cache upgrade \ +&& apk --no-progress --purge --no-cache add --upgrade \ + curl \ + wget \ + openssh \ +&& apk --no-progress --purge --no-cache upgrade \ +&& rm -vrf /var/cache/apk/* \ +&& curl --version + +RUN curl -o /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \ +&& curl -LO https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.32-r0/glibc-2.32-r0.apk \ +&& apk add glibc-2.32-r0.apk + +#Install JDK8. +RUN set -eux; \ + apk add --no-cache --virtual .fetch-deps curl; \ + ARCH="$(apk --print-arch)"; \ + case "${ARCH}" in \ + amd64|x86_64) \ + ESUM='389c0d2ea59742103f46f1dd6d2c83e43e9f935f3f0485b1f9e74ac4e8c5ce47'; \ + BINARY_URL='https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u362-b09/OpenJDK8U-jdk_x64_alpine-linux_hotspot_8u362b09.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" ENV=${USER_HOME}"/.ashrc" # set Docker image build arguments # build arguments for user/group configurations @@ -32,6 +80,7 @@ ARG USER_HOME=/home/${USER} ARG WSO2_SERVER_NAME=wso2is-analytics ARG WSO2_SERVER_VERSION=5.8.0 ARG WSO2_SERVER=${WSO2_SERVER_NAME}-${WSO2_SERVER_VERSION} +ARG WSO2_SERVER_REPOSITORY=product-is ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER} ARG WSO2_SERVER_DIST_URL=https://bintray.com/wso2/binaryGA/download_file?file_path=${WSO2_SERVER}.zip # build arguments for external artifacts @@ -54,7 +103,11 @@ RUN \ # copy init script to user home COPY --chown=wso2carbon:wso2 docker-entrypoint.sh ${USER_HOME}/ # install required packages -RUN apk add --no-cache netcat-openbsd +RUN \ + apk update \ + && apk add --no-cache netcat-openbsd \ + && apk add unzip \ + && apk add wget # add the WSO2 product distribution to user's home directory RUN \ wget -O ${WSO2_SERVER}.zip "${WSO2_SERVER_DIST_URL}" \ diff --git a/dockerfiles/alpine/is/Dockerfile b/dockerfiles/alpine/is/Dockerfile index 12fb8c0f..9c6b9984 100644 --- a/dockerfiles/alpine/is/Dockerfile +++ b/dockerfiles/alpine/is/Dockerfile @@ -16,10 +16,58 @@ # # ------------------------------------------------------------------------ -# set base Docker image to AdoptOpenJDK Alpine Docker image -FROM adoptopenjdk/openjdk8:jdk8u212-b03-alpine +# Set base Docker image to Alpine Docker image. +FROM alpine:3.15.0 LABEL maintainer="WSO2 Docker Maintainers " \ - com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.0.6" + com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.1.0" +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 jdk8u362-b09 + +RUN apk --no-progress --purge --no-cache upgrade \ +&& apk --no-progress --purge --no-cache add --upgrade \ + curl \ + wget \ + openssh \ +&& apk --no-progress --purge --no-cache upgrade \ +&& rm -vrf /var/cache/apk/* \ +&& curl --version + +RUN curl -o /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \ +&& curl -LO https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.32-r0/glibc-2.32-r0.apk \ +&& apk add glibc-2.32-r0.apk + +#Install JDK8. +RUN set -eux; \ + apk add --no-cache --virtual .fetch-deps curl; \ + ARCH="$(apk --print-arch)"; \ + case "${ARCH}" in \ + amd64|x86_64) \ + ESUM='389c0d2ea59742103f46f1dd6d2c83e43e9f935f3f0485b1f9e74ac4e8c5ce47'; \ + BINARY_URL='https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u362-b09/OpenJDK8U-jdk_x64_alpine-linux_hotspot_8u362b09.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" ENV=${USER_HOME}"/.ashrc" # set Docker image build arguments # build arguments for user/group configurations @@ -31,6 +79,7 @@ ARG USER_HOME=/home/${USER} # build arguments for WSO2 product installation ARG WSO2_SERVER_NAME=wso2is ARG WSO2_SERVER_VERSION=5.8.0 +ARG WSO2_SERVER_REPOSITORY=product-is ARG WSO2_SERVER=${WSO2_SERVER_NAME}-${WSO2_SERVER_VERSION} ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER} ARG WSO2_SERVER_DIST_URL=https://bintray.com/wso2/binaryGA/download_file?file_path=${WSO2_SERVER}.zip @@ -63,14 +112,21 @@ RUN \ # copy init script to user home COPY --chown=wso2carbon:wso2 docker-entrypoint.sh ${USER_HOME}/ + # install required packages -RUN apk add --no-cache netcat-openbsd +RUN \ + apk update \ + && apk add --no-cache netcat-openbsd \ + && apk add unzip \ + && apk add wget \ + # add the WSO2 product distribution to user's home directory RUN \ wget -O ${WSO2_SERVER}.zip "${WSO2_SERVER_DIST_URL}" \ && unzip -d ${USER_HOME} ${WSO2_SERVER}.zip \ && chown wso2carbon:wso2 -R ${WSO2_SERVER_HOME} \ - && rm -f ${WSO2_SERVER}.zip + && rm -f ${WSO2_SERVER}.zip \ + # add libraries for Kubernetes membership scheme based clustering ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/dnsjava/dnsjava/${DNS_JAVA_VERSION}/dnsjava-${DNS_JAVA_VERSION}.jar ${WSO2_SERVER_HOME}/repository/components/lib ADD --chown=wso2carbon:wso2 http://maven.wso2.org/nexus/content/repositories/releases/org/wso2/carbon/kubernetes/artifacts/kubernetes-membership-scheme/${K8S_MEMBERSHIP_SCHEME_VERSION}/kubernetes-membership-scheme-${K8S_MEMBERSHIP_SCHEME_VERSION}.jar ${WSO2_SERVER_HOME}/repository/components/dropins/ diff --git a/dockerfiles/centos/is-analytics/dashboard/Dockerfile b/dockerfiles/centos/is-analytics/dashboard/Dockerfile index 4cae68ad..d0051880 100644 --- a/dockerfiles/centos/is-analytics/dashboard/Dockerfile +++ b/dockerfiles/centos/is-analytics/dashboard/Dockerfile @@ -16,10 +16,40 @@ # # ------------------------------------------------------------------------ -# set base Docker image to latest CentOS Docker image +# Set base Docker image to CentOS Docker image. FROM centos:7 LABEL maintainer="WSO2 Docker Maintainers " \ - com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.0.9" + com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.1.0" +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 jdk8u362-b09 + +# Install JDK8. +RUN set -eux; \ + ARCH="$(objdump="$(command -v objdump)" && objdump --file-headers "$objdump" | awk -F '[:,]+[[:space:]]+' '$1 == "architecture" { print $2 }')"; \ + case "${ARCH}" in \ + amd64|i386:x86-64) \ + ESUM='1486a792fb224611ce0cd0e83d4aacd3503b56698549f8e9a9f0a6ebb83bdba1'; \ + BINARY_URL='https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u362-b09/OpenJDK8U-jdk_x64_linux_hotspot_8u362b09.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" # set Docker image build arguments # build arguments for user/group configurations @@ -28,11 +58,10 @@ ARG USER_ID=802 ARG USER_GROUP=wso2 ARG USER_GROUP_ID=802 ARG USER_HOME=/home/${USER} -# set JDK configurations -ARG JAVA_HOME=${USER_HOME}/java # build arguments for WSO2 product installation ARG WSO2_SERVER_NAME=wso2is-analytics ARG WSO2_SERVER_VERSION=5.8.0 +ARG WSO2_SERVER_REPOSITORY=product-is ARG WSO2_SERVER=${WSO2_SERVER_NAME}-${WSO2_SERVER_VERSION} ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER} ARG WSO2_SERVER_DIST_URL=https://bintray.com/wso2/binaryGA/download_file?file_path=${WSO2_SERVER}.zip @@ -51,9 +80,16 @@ RUN \ groupadd --system -g ${USER_GROUP_ID} ${USER_GROUP} \ && useradd --system --create-home --home-dir ${USER_HOME} --no-log-init -g ${USER_GROUP_ID} -u ${USER_ID} ${USER} \ && echo ${MOTD} > /etc/profile.d/motd.sh - +# create Java prefs dir +# this is to avoid warning logs printed by FileSystemPreferences class +RUN \ + mkdir -p ${USER_HOME}/.java/.systemPrefs \ + && mkdir -p ${USER_HOME}/.java/.userPrefs \ + && chmod -R 755 ${USER_HOME}/.java \ + && chown -R ${USER}:${USER_GROUP} ${USER_HOME}/.java # copy init script to user home COPY --chown=wso2carbon:wso2 docker-entrypoint.sh ${USER_HOME}/ + # install required packages RUN \ yum -y update \ @@ -62,14 +98,7 @@ RUN \ unzip \ wget \ && rm -rf /var/cache/yum/* -# install AdoptOpenJDK HotSpot -RUN \ - mkdir -p ${JAVA_HOME} \ - && wget -O OpenJDK8U-jdk_x64_linux_hotspot.tar.gz https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u212-b03/OpenJDK8U-jdk_x64_linux_hotspot_8u212b03.tar.gz \ - && echo "dd28d6d2cde2b931caf94ac2422a2ad082ea62f0beee3bf7057317c53093de93 OpenJDK8U-jdk_x64_linux_hotspot.tar.gz" | sha256sum -c - \ - && tar -xf OpenJDK8U-jdk_x64_linux_hotspot.tar.gz -C ${JAVA_HOME} --strip-components=1 \ - && chown wso2carbon:wso2 -R ${JAVA_HOME} \ - && rm -f OpenJDK8U-jdk_x64_linux_hotspot.tar.gz + # add the WSO2 product distribution to user's home directory RUN \ wget -O ${WSO2_SERVER}.zip "${WSO2_SERVER_DIST_URL}" \ @@ -86,7 +115,7 @@ WORKDIR ${USER_HOME} # set environment variables ENV JAVA_HOME=${JAVA_HOME} \ PATH=${JAVA_HOME}/bin:${PATH} \ - WORKING_DIRECTORY=${USER_HOME} \ +ENV WORKING_DIRECTORY=${USER_HOME} \ WSO2_SERVER_HOME=${WSO2_SERVER_HOME} # expose ports diff --git a/dockerfiles/centos/is-analytics/worker/Dockerfile b/dockerfiles/centos/is-analytics/worker/Dockerfile index 1384a49a..c5355856 100644 --- a/dockerfiles/centos/is-analytics/worker/Dockerfile +++ b/dockerfiles/centos/is-analytics/worker/Dockerfile @@ -16,10 +16,40 @@ # # ------------------------------------------------------------------------ -# set base Docker image to latest CentOS Docker image +# Set base Docker image to CentOS Docker image. FROM centos:7 LABEL maintainer="WSO2 Docker Maintainers " \ - com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.0.9" + com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.1.0" +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 jdk8u362-b09 + +# Install JDK8. +RUN set -eux; \ + ARCH="$(objdump="$(command -v objdump)" && objdump --file-headers "$objdump" | awk -F '[:,]+[[:space:]]+' '$1 == "architecture" { print $2 }')"; \ + case "${ARCH}" in \ + amd64|i386:x86-64) \ + ESUM='1486a792fb224611ce0cd0e83d4aacd3503b56698549f8e9a9f0a6ebb83bdba1'; \ + BINARY_URL='https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u362-b09/OpenJDK8U-jdk_x64_linux_hotspot_8u362b09.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" # set Docker image build arguments # build arguments for user/group configurations @@ -28,11 +58,10 @@ ARG USER_ID=802 ARG USER_GROUP=wso2 ARG USER_GROUP_ID=802 ARG USER_HOME=/home/${USER} -# set JDK configurations -ARG JAVA_HOME=${USER_HOME}/java # build arguments for WSO2 product installation ARG WSO2_SERVER_NAME=wso2is-analytics ARG WSO2_SERVER_VERSION=5.8.0 +ARG WSO2_SERVER_REPOSITORY=product-is ARG WSO2_SERVER=${WSO2_SERVER_NAME}-${WSO2_SERVER_VERSION} ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER} ARG WSO2_SERVER_DIST_URL=https://bintray.com/wso2/binaryGA/download_file?file_path=${WSO2_SERVER}.zip @@ -51,9 +80,16 @@ RUN \ groupadd --system -g ${USER_GROUP_ID} ${USER_GROUP} \ && useradd --system --create-home --home-dir ${USER_HOME} --no-log-init -g ${USER_GROUP_ID} -u ${USER_ID} ${USER} \ && echo ${MOTD} > /etc/profile.d/motd.sh - +# create Java prefs dir +# this is to avoid warning logs printed by FileSystemPreferences class +RUN \ + mkdir -p ${USER_HOME}/.java/.systemPrefs \ + && mkdir -p ${USER_HOME}/.java/.userPrefs \ + && chmod -R 755 ${USER_HOME}/.java \ + && chown -R ${USER}:${USER_GROUP} ${USER_HOME}/.java # copy init script to user home COPY --chown=wso2carbon:wso2 docker-entrypoint.sh ${USER_HOME}/ + # install required packages RUN \ yum -y update \ @@ -62,14 +98,7 @@ RUN \ unzip \ wget \ && rm -rf /var/cache/yum/* -# install AdoptOpenJDK HotSpot -RUN \ - mkdir -p ${JAVA_HOME} \ - && wget -O OpenJDK8U-jdk_x64_linux_hotspot.tar.gz https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u212-b03/OpenJDK8U-jdk_x64_linux_hotspot_8u212b03.tar.gz \ - && echo "dd28d6d2cde2b931caf94ac2422a2ad082ea62f0beee3bf7057317c53093de93 OpenJDK8U-jdk_x64_linux_hotspot.tar.gz" | sha256sum -c - \ - && tar -xf OpenJDK8U-jdk_x64_linux_hotspot.tar.gz -C ${JAVA_HOME} --strip-components=1 \ - && chown wso2carbon:wso2 -R ${JAVA_HOME} \ - && rm -f OpenJDK8U-jdk_x64_linux_hotspot.tar.gz + # add the WSO2 product distribution to user's home directory RUN \ wget -O ${WSO2_SERVER}.zip "${WSO2_SERVER_DIST_URL}" \ @@ -86,7 +115,7 @@ WORKDIR ${USER_HOME} # set environment variables ENV JAVA_HOME=${JAVA_HOME} \ PATH=${JAVA_HOME}/bin:${PATH} \ - WORKING_DIRECTORY=${USER_HOME} \ +ENV WORKING_DIRECTORY=${USER_HOME} \ WSO2_SERVER_HOME=${WSO2_SERVER_HOME} # expose ports diff --git a/dockerfiles/centos/is/Dockerfile b/dockerfiles/centos/is/Dockerfile index f2288296..17117e40 100644 --- a/dockerfiles/centos/is/Dockerfile +++ b/dockerfiles/centos/is/Dockerfile @@ -16,10 +16,40 @@ # # ------------------------------------------------------------------------ -# set base Docker image to latest CentOS Docker image +# Set base Docker image to CentOS Docker image. FROM centos:7 LABEL maintainer="WSO2 Docker Maintainers " \ - com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.0.6" + com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.1.0" +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 jdk8u362-b09 + +# Install JDK8. +RUN set -eux; \ + ARCH="$(objdump="$(command -v objdump)" && objdump --file-headers "$objdump" | awk -F '[:,]+[[:space:]]+' '$1 == "architecture" { print $2 }')"; \ + case "${ARCH}" in \ + amd64|i386:x86-64) \ + ESUM='1486a792fb224611ce0cd0e83d4aacd3503b56698549f8e9a9f0a6ebb83bdba1'; \ + BINARY_URL='https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u362-b09/OpenJDK8U-jdk_x64_linux_hotspot_8u362b09.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" # set Docker image build arguments # build arguments for user/group configurations @@ -28,11 +58,10 @@ ARG USER_ID=802 ARG USER_GROUP=wso2 ARG USER_GROUP_ID=802 ARG USER_HOME=/home/${USER} -# set JDK configurations -ARG JAVA_HOME=${USER_HOME}/java # build arguments for WSO2 product installation ARG WSO2_SERVER_NAME=wso2is ARG WSO2_SERVER_VERSION=5.8.0 +ARG WSO2_SERVER_REPOSITORY=product-is ARG WSO2_SERVER=${WSO2_SERVER_NAME}-${WSO2_SERVER_VERSION} ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER} ARG WSO2_SERVER_DIST_URL=https://bintray.com/wso2/binaryGA/download_file?file_path=${WSO2_SERVER}.zip @@ -53,9 +82,16 @@ RUN \ groupadd --system -g ${USER_GROUP_ID} ${USER_GROUP} \ && useradd --system --create-home --home-dir ${USER_HOME} --no-log-init -g ${USER_GROUP_ID} -u ${USER_ID} ${USER} \ && echo ${MOTD} > /etc/profile.d/motd.sh - +# create Java prefs dir +# this is to avoid warning logs printed by FileSystemPreferences class +RUN \ + mkdir -p ${USER_HOME}/.java/.systemPrefs \ + && mkdir -p ${USER_HOME}/.java/.userPrefs \ + && chmod -R 755 ${USER_HOME}/.java \ + && chown -R ${USER}:${USER_GROUP} ${USER_HOME}/.java # copy init script to user home COPY --chown=wso2carbon:wso2 docker-entrypoint.sh ${USER_HOME}/ + # install required packages RUN \ yum -y update \ @@ -64,14 +100,7 @@ RUN \ unzip \ wget \ && rm -rf /var/cache/yum/* -# install AdoptOpenJDK HotSpot -RUN \ - mkdir -p ${JAVA_HOME} \ - && wget -O OpenJDK8U-jdk_x64_linux_hotspot.tar.gz https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u212-b03/OpenJDK8U-jdk_x64_linux_hotspot_8u212b03.tar.gz \ - && echo "dd28d6d2cde2b931caf94ac2422a2ad082ea62f0beee3bf7057317c53093de93 OpenJDK8U-jdk_x64_linux_hotspot.tar.gz" | sha256sum -c - \ - && tar -xf OpenJDK8U-jdk_x64_linux_hotspot.tar.gz -C ${JAVA_HOME} --strip-components=1 \ - && chown wso2carbon:wso2 -R ${JAVA_HOME} \ - && rm -f OpenJDK8U-jdk_x64_linux_hotspot.tar.gz + # add the WSO2 product distribution to user's home directory RUN \ wget -O ${WSO2_SERVER}.zip "${WSO2_SERVER_DIST_URL}" \ @@ -91,7 +120,7 @@ WORKDIR ${USER_HOME} # set environment variables ENV JAVA_HOME=${JAVA_HOME} \ PATH=${JAVA_HOME}/bin:${PATH} \ - WORKING_DIRECTORY=${USER_HOME} \ +ENV WORKING_DIRECTORY=${USER_HOME} \ WSO2_SERVER_HOME=${WSO2_SERVER_HOME} # expose ports diff --git a/dockerfiles/ubuntu/is-analytics/dashboard/Dockerfile b/dockerfiles/ubuntu/is-analytics/dashboard/Dockerfile index b08fb180..9268861a 100644 --- a/dockerfiles/ubuntu/is-analytics/dashboard/Dockerfile +++ b/dockerfiles/ubuntu/is-analytics/dashboard/Dockerfile @@ -19,7 +19,7 @@ # set base Docker image to JDK Ubuntu 20.04 Docker image FROM ubuntu:20.04 LABEL maintainer="WSO2 Docker Maintainers " \ - com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.0.8" + com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.1.0" #Install Open JDK ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' @@ -30,14 +30,14 @@ RUN apt-get update \ && locale-gen en_US.UTF-8 \ && rm -rf /var/lib/apt/lists/* -ENV JAVA_VERSION jdk8u292-b10 +ENV JAVA_VERSION jdk8u362-b09 RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ amd64|x86_64) \ - ESUM='699981083983b60a7eeb511ad640fae3ae4b879de5a3980fe837e8ade9c34a08'; \ - BINARY_URL='https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u312-b07/OpenJDK8U-jdk_x64_linux_hotspot_8u312b07.tar.gz'; \ + ESUM='1486a792fb224611ce0cd0e83d4aacd3503b56698549f8e9a9f0a6ebb83bdba1'; \ + BINARY_URL='https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u362-b09/OpenJDK8U-jdk_x64_linux_hotspot_8u362b09.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/dockerfiles/ubuntu/is-analytics/worker/Dockerfile b/dockerfiles/ubuntu/is-analytics/worker/Dockerfile index e4b58f54..6330e46d 100644 --- a/dockerfiles/ubuntu/is-analytics/worker/Dockerfile +++ b/dockerfiles/ubuntu/is-analytics/worker/Dockerfile @@ -19,7 +19,7 @@ # set base Docker image to JDK Ubuntu 20.04 Docker image FROM ubuntu:20.04 LABEL maintainer="WSO2 Docker Maintainers " \ - com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.0.8" + com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.1.0" #Install Open JDK ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' @@ -30,14 +30,14 @@ RUN apt-get update \ && locale-gen en_US.UTF-8 \ && rm -rf /var/lib/apt/lists/* -ENV JAVA_VERSION jdk8u292-b10 +ENV JAVA_VERSION jdk8u362-b09 RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ amd64|x86_64) \ - ESUM='699981083983b60a7eeb511ad640fae3ae4b879de5a3980fe837e8ade9c34a08'; \ - BINARY_URL='https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u312-b07/OpenJDK8U-jdk_x64_linux_hotspot_8u312b07.tar.gz'; \ + ESUM='1486a792fb224611ce0cd0e83d4aacd3503b56698549f8e9a9f0a6ebb83bdba1'; \ + BINARY_URL='https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u362-b09/OpenJDK8U-jdk_x64_linux_hotspot_8u362b09.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ diff --git a/dockerfiles/ubuntu/is/Dockerfile b/dockerfiles/ubuntu/is/Dockerfile index 1cbed7da..d30489fb 100644 --- a/dockerfiles/ubuntu/is/Dockerfile +++ b/dockerfiles/ubuntu/is/Dockerfile @@ -19,7 +19,7 @@ # set base Docker image to JDK Ubuntu 20.04 Docker image FROM ubuntu:20.04 LABEL maintainer="WSO2 Docker Maintainers " \ - com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.0.8" + com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.1.0" #Install Open JDK ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' @@ -30,14 +30,14 @@ RUN apt-get update \ && locale-gen en_US.UTF-8 \ && rm -rf /var/lib/apt/lists/* -ENV JAVA_VERSION jdk8u292-b10 +ENV JAVA_VERSION jdk8u362-b09 RUN set -eux; \ ARCH="$(dpkg --print-architecture)"; \ case "${ARCH}" in \ amd64|x86_64) \ - ESUM='699981083983b60a7eeb511ad640fae3ae4b879de5a3980fe837e8ade9c34a08'; \ - BINARY_URL='https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u312-b07/OpenJDK8U-jdk_x64_linux_hotspot_8u312b07.tar.gz'; \ + ESUM='1486a792fb224611ce0cd0e83d4aacd3503b56698549f8e9a9f0a6ebb83bdba1'; \ + BINARY_URL='https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u362-b09/OpenJDK8U-jdk_x64_linux_hotspot_8u362b09.tar.gz'; \ ;; \ *) \ echo "Unsupported arch: ${ARCH}"; \ From 90c206d88324069f751b0d9bc6df6e7c8bb50cc4 Mon Sep 17 00:00:00 2001 From: Yoshani Date: Tue, 31 Jan 2023 13:22:31 +0530 Subject: [PATCH 02/13] Update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99682946..a15e191a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ All notable changes to this project 5.8.x per each release will be documented in The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +## [v5.8.1.0] - 2023-01-31 + +### Changed +- Update base image of dockerfiles to an OS image and installed relevant JDK on it, instead of using a JDK installed OS image. + ## [v5.8.0.9] - 2022-04-28 ### Changed From da1f8aad71ebfd5fb5d71b909775834b52994a06 Mon Sep 17 00:00:00 2001 From: Yoshani Date: Tue, 31 Jan 2023 15:07:25 +0530 Subject: [PATCH 03/13] Update tag --- CHANGELOG.md | 2 +- dockerfiles/alpine/is-analytics/dashboard/Dockerfile | 2 +- dockerfiles/alpine/is-analytics/worker/Dockerfile | 2 +- dockerfiles/alpine/is/Dockerfile | 2 +- dockerfiles/centos/is-analytics/dashboard/Dockerfile | 2 +- dockerfiles/centos/is-analytics/worker/Dockerfile | 2 +- dockerfiles/centos/is/Dockerfile | 2 +- dockerfiles/ubuntu/is-analytics/dashboard/Dockerfile | 2 +- dockerfiles/ubuntu/is-analytics/worker/Dockerfile | 2 +- dockerfiles/ubuntu/is/Dockerfile | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a15e191a..f99d0070 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to this project 5.8.x per each release will be documented in The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -## [v5.8.1.0] - 2023-01-31 +## [v5.8.0.10] - 2023-01-31 ### Changed - Update base image of dockerfiles to an OS image and installed relevant JDK on it, instead of using a JDK installed OS image. diff --git a/dockerfiles/alpine/is-analytics/dashboard/Dockerfile b/dockerfiles/alpine/is-analytics/dashboard/Dockerfile index 654f602f..823364ae 100644 --- a/dockerfiles/alpine/is-analytics/dashboard/Dockerfile +++ b/dockerfiles/alpine/is-analytics/dashboard/Dockerfile @@ -19,7 +19,7 @@ # Set base Docker image to Alpine Docker image. FROM alpine:3.15.0 LABEL maintainer="WSO2 Docker Maintainers " \ - com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.1.0" + com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.0.10" ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' # Install JDK Dependencies. diff --git a/dockerfiles/alpine/is-analytics/worker/Dockerfile b/dockerfiles/alpine/is-analytics/worker/Dockerfile index d1ec5b5b..3d8d3834 100644 --- a/dockerfiles/alpine/is-analytics/worker/Dockerfile +++ b/dockerfiles/alpine/is-analytics/worker/Dockerfile @@ -19,7 +19,7 @@ # Set base Docker image to Alpine Docker image. FROM alpine:3.15.0 LABEL maintainer="WSO2 Docker Maintainers " \ - com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.1.0" + com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.0.10" ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' # Install JDK Dependencies. diff --git a/dockerfiles/alpine/is/Dockerfile b/dockerfiles/alpine/is/Dockerfile index 9c6b9984..26699855 100644 --- a/dockerfiles/alpine/is/Dockerfile +++ b/dockerfiles/alpine/is/Dockerfile @@ -19,7 +19,7 @@ # Set base Docker image to Alpine Docker image. FROM alpine:3.15.0 LABEL maintainer="WSO2 Docker Maintainers " \ - com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.1.0" + com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.0.10" ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' # Install JDK Dependencies. diff --git a/dockerfiles/centos/is-analytics/dashboard/Dockerfile b/dockerfiles/centos/is-analytics/dashboard/Dockerfile index d0051880..8d5f85f0 100644 --- a/dockerfiles/centos/is-analytics/dashboard/Dockerfile +++ b/dockerfiles/centos/is-analytics/dashboard/Dockerfile @@ -19,7 +19,7 @@ # Set base Docker image to CentOS Docker image. FROM centos:7 LABEL maintainer="WSO2 Docker Maintainers " \ - com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.1.0" + com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.0.10" ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' # Install JDK Dependencies. diff --git a/dockerfiles/centos/is-analytics/worker/Dockerfile b/dockerfiles/centos/is-analytics/worker/Dockerfile index c5355856..81e2da3c 100644 --- a/dockerfiles/centos/is-analytics/worker/Dockerfile +++ b/dockerfiles/centos/is-analytics/worker/Dockerfile @@ -19,7 +19,7 @@ # Set base Docker image to CentOS Docker image. FROM centos:7 LABEL maintainer="WSO2 Docker Maintainers " \ - com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.1.0" + com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.0.10" ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' # Install JDK Dependencies. diff --git a/dockerfiles/centos/is/Dockerfile b/dockerfiles/centos/is/Dockerfile index 17117e40..5176480a 100644 --- a/dockerfiles/centos/is/Dockerfile +++ b/dockerfiles/centos/is/Dockerfile @@ -19,7 +19,7 @@ # Set base Docker image to CentOS Docker image. FROM centos:7 LABEL maintainer="WSO2 Docker Maintainers " \ - com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.1.0" + com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.0.10" ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' # Install JDK Dependencies. diff --git a/dockerfiles/ubuntu/is-analytics/dashboard/Dockerfile b/dockerfiles/ubuntu/is-analytics/dashboard/Dockerfile index 9268861a..3e88398e 100644 --- a/dockerfiles/ubuntu/is-analytics/dashboard/Dockerfile +++ b/dockerfiles/ubuntu/is-analytics/dashboard/Dockerfile @@ -19,7 +19,7 @@ # set base Docker image to JDK Ubuntu 20.04 Docker image FROM ubuntu:20.04 LABEL maintainer="WSO2 Docker Maintainers " \ - com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.1.0" + com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.0.10" #Install Open JDK ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' diff --git a/dockerfiles/ubuntu/is-analytics/worker/Dockerfile b/dockerfiles/ubuntu/is-analytics/worker/Dockerfile index 6330e46d..3cca13e1 100644 --- a/dockerfiles/ubuntu/is-analytics/worker/Dockerfile +++ b/dockerfiles/ubuntu/is-analytics/worker/Dockerfile @@ -19,7 +19,7 @@ # set base Docker image to JDK Ubuntu 20.04 Docker image FROM ubuntu:20.04 LABEL maintainer="WSO2 Docker Maintainers " \ - com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.1.0" + com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.0.10" #Install Open JDK ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' diff --git a/dockerfiles/ubuntu/is/Dockerfile b/dockerfiles/ubuntu/is/Dockerfile index d30489fb..40944b95 100644 --- a/dockerfiles/ubuntu/is/Dockerfile +++ b/dockerfiles/ubuntu/is/Dockerfile @@ -19,7 +19,7 @@ # set base Docker image to JDK Ubuntu 20.04 Docker image FROM ubuntu:20.04 LABEL maintainer="WSO2 Docker Maintainers " \ - com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.1.0" + com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.0.10" #Install Open JDK ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' From c426c352454397a61a97aa7065664cf5a49fe880 Mon Sep 17 00:00:00 2001 From: Yoshani Date: Tue, 31 Jan 2023 16:00:41 +0530 Subject: [PATCH 04/13] Remove fix to avoid warning logs --- dockerfiles/centos/is-analytics/dashboard/Dockerfile | 8 +------- dockerfiles/centos/is-analytics/worker/Dockerfile | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/dockerfiles/centos/is-analytics/dashboard/Dockerfile b/dockerfiles/centos/is-analytics/dashboard/Dockerfile index 8d5f85f0..bb079c82 100644 --- a/dockerfiles/centos/is-analytics/dashboard/Dockerfile +++ b/dockerfiles/centos/is-analytics/dashboard/Dockerfile @@ -80,13 +80,7 @@ RUN \ groupadd --system -g ${USER_GROUP_ID} ${USER_GROUP} \ && useradd --system --create-home --home-dir ${USER_HOME} --no-log-init -g ${USER_GROUP_ID} -u ${USER_ID} ${USER} \ && echo ${MOTD} > /etc/profile.d/motd.sh -# create Java prefs dir -# this is to avoid warning logs printed by FileSystemPreferences class -RUN \ - mkdir -p ${USER_HOME}/.java/.systemPrefs \ - && mkdir -p ${USER_HOME}/.java/.userPrefs \ - && chmod -R 755 ${USER_HOME}/.java \ - && chown -R ${USER}:${USER_GROUP} ${USER_HOME}/.java + # copy init script to user home COPY --chown=wso2carbon:wso2 docker-entrypoint.sh ${USER_HOME}/ diff --git a/dockerfiles/centos/is-analytics/worker/Dockerfile b/dockerfiles/centos/is-analytics/worker/Dockerfile index 81e2da3c..9d1c9b30 100644 --- a/dockerfiles/centos/is-analytics/worker/Dockerfile +++ b/dockerfiles/centos/is-analytics/worker/Dockerfile @@ -80,13 +80,7 @@ RUN \ groupadd --system -g ${USER_GROUP_ID} ${USER_GROUP} \ && useradd --system --create-home --home-dir ${USER_HOME} --no-log-init -g ${USER_GROUP_ID} -u ${USER_ID} ${USER} \ && echo ${MOTD} > /etc/profile.d/motd.sh -# create Java prefs dir -# this is to avoid warning logs printed by FileSystemPreferences class -RUN \ - mkdir -p ${USER_HOME}/.java/.systemPrefs \ - && mkdir -p ${USER_HOME}/.java/.userPrefs \ - && chmod -R 755 ${USER_HOME}/.java \ - && chown -R ${USER}:${USER_GROUP} ${USER_HOME}/.java + # copy init script to user home COPY --chown=wso2carbon:wso2 docker-entrypoint.sh ${USER_HOME}/ From 9d25927afec2916ad1b12282d305c6c8ad87ef6e Mon Sep 17 00:00:00 2001 From: Yoshani Date: Tue, 31 Jan 2023 16:04:04 +0530 Subject: [PATCH 05/13] Remove extra line --- dockerfiles/alpine/is/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerfiles/alpine/is/Dockerfile b/dockerfiles/alpine/is/Dockerfile index 26699855..f874cc9f 100644 --- a/dockerfiles/alpine/is/Dockerfile +++ b/dockerfiles/alpine/is/Dockerfile @@ -125,7 +125,7 @@ RUN \ wget -O ${WSO2_SERVER}.zip "${WSO2_SERVER_DIST_URL}" \ && unzip -d ${USER_HOME} ${WSO2_SERVER}.zip \ && chown wso2carbon:wso2 -R ${WSO2_SERVER_HOME} \ - && rm -f ${WSO2_SERVER}.zip \ + && rm -f ${WSO2_SERVER}.zip # add libraries for Kubernetes membership scheme based clustering ADD --chown=wso2carbon:wso2 https://repo1.maven.org/maven2/dnsjava/dnsjava/${DNS_JAVA_VERSION}/dnsjava-${DNS_JAVA_VERSION}.jar ${WSO2_SERVER_HOME}/repository/components/lib From 5743c394eee448d260241df813ef53a8aeff3121 Mon Sep 17 00:00:00 2001 From: Yoshani Date: Tue, 31 Jan 2023 16:11:01 +0530 Subject: [PATCH 06/13] Remove extra env variables --- dockerfiles/centos/is-analytics/dashboard/Dockerfile | 2 -- dockerfiles/centos/is-analytics/worker/Dockerfile | 2 -- dockerfiles/centos/is/Dockerfile | 2 -- 3 files changed, 6 deletions(-) diff --git a/dockerfiles/centos/is-analytics/dashboard/Dockerfile b/dockerfiles/centos/is-analytics/dashboard/Dockerfile index bb079c82..2bcd6ca8 100644 --- a/dockerfiles/centos/is-analytics/dashboard/Dockerfile +++ b/dockerfiles/centos/is-analytics/dashboard/Dockerfile @@ -107,8 +107,6 @@ USER ${USER_ID} WORKDIR ${USER_HOME} # set environment variables -ENV JAVA_HOME=${JAVA_HOME} \ - PATH=${JAVA_HOME}/bin:${PATH} \ ENV WORKING_DIRECTORY=${USER_HOME} \ WSO2_SERVER_HOME=${WSO2_SERVER_HOME} diff --git a/dockerfiles/centos/is-analytics/worker/Dockerfile b/dockerfiles/centos/is-analytics/worker/Dockerfile index 9d1c9b30..db4e08fb 100644 --- a/dockerfiles/centos/is-analytics/worker/Dockerfile +++ b/dockerfiles/centos/is-analytics/worker/Dockerfile @@ -107,8 +107,6 @@ USER ${USER_ID} WORKDIR ${USER_HOME} # set environment variables -ENV JAVA_HOME=${JAVA_HOME} \ - PATH=${JAVA_HOME}/bin:${PATH} \ ENV WORKING_DIRECTORY=${USER_HOME} \ WSO2_SERVER_HOME=${WSO2_SERVER_HOME} diff --git a/dockerfiles/centos/is/Dockerfile b/dockerfiles/centos/is/Dockerfile index 5176480a..c2ea7918 100644 --- a/dockerfiles/centos/is/Dockerfile +++ b/dockerfiles/centos/is/Dockerfile @@ -118,8 +118,6 @@ USER ${USER_ID} WORKDIR ${USER_HOME} # set environment variables -ENV JAVA_HOME=${JAVA_HOME} \ - PATH=${JAVA_HOME}/bin:${PATH} \ ENV WORKING_DIRECTORY=${USER_HOME} \ WSO2_SERVER_HOME=${WSO2_SERVER_HOME} From fcee412fa9f2a42c747f59ccb2debd5812e4b1b8 Mon Sep 17 00:00:00 2001 From: Yoshani Date: Tue, 31 Jan 2023 18:39:10 +0530 Subject: [PATCH 07/13] Remove empty continuation line --- dockerfiles/alpine/is/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerfiles/alpine/is/Dockerfile b/dockerfiles/alpine/is/Dockerfile index f874cc9f..f1b7d0e1 100644 --- a/dockerfiles/alpine/is/Dockerfile +++ b/dockerfiles/alpine/is/Dockerfile @@ -118,7 +118,7 @@ RUN \ apk update \ && apk add --no-cache netcat-openbsd \ && apk add unzip \ - && apk add wget \ + && apk add wget # add the WSO2 product distribution to user's home directory RUN \ From 3a296be610f3ef8f20c2605d5caf3d86af215a26 Mon Sep 17 00:00:00 2001 From: Yoshani Date: Tue, 31 Jan 2023 19:11:12 +0530 Subject: [PATCH 08/13] Remove arg WSO2_SERVER_REPOSITORY --- dockerfiles/alpine/is-analytics/dashboard/Dockerfile | 1 - dockerfiles/alpine/is-analytics/worker/Dockerfile | 1 - dockerfiles/centos/is-analytics/dashboard/Dockerfile | 1 - dockerfiles/centos/is-analytics/worker/Dockerfile | 1 - 4 files changed, 4 deletions(-) diff --git a/dockerfiles/alpine/is-analytics/dashboard/Dockerfile b/dockerfiles/alpine/is-analytics/dashboard/Dockerfile index 823364ae..b880b206 100644 --- a/dockerfiles/alpine/is-analytics/dashboard/Dockerfile +++ b/dockerfiles/alpine/is-analytics/dashboard/Dockerfile @@ -79,7 +79,6 @@ ARG USER_HOME=/home/${USER} # build arguments for WSO2 product installation ARG WSO2_SERVER_NAME=wso2is-analytics ARG WSO2_SERVER_VERSION=5.8.0 -ARG WSO2_SERVER_REPOSITORY=product-is ARG WSO2_SERVER=${WSO2_SERVER_NAME}-${WSO2_SERVER_VERSION} ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER} ARG WSO2_SERVER_DIST_URL=https://bintray.com/wso2/binaryGA/download_file?file_path=${WSO2_SERVER}.zip diff --git a/dockerfiles/alpine/is-analytics/worker/Dockerfile b/dockerfiles/alpine/is-analytics/worker/Dockerfile index 3d8d3834..8e2bd989 100644 --- a/dockerfiles/alpine/is-analytics/worker/Dockerfile +++ b/dockerfiles/alpine/is-analytics/worker/Dockerfile @@ -80,7 +80,6 @@ ARG USER_HOME=/home/${USER} ARG WSO2_SERVER_NAME=wso2is-analytics ARG WSO2_SERVER_VERSION=5.8.0 ARG WSO2_SERVER=${WSO2_SERVER_NAME}-${WSO2_SERVER_VERSION} -ARG WSO2_SERVER_REPOSITORY=product-is ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER} ARG WSO2_SERVER_DIST_URL=https://bintray.com/wso2/binaryGA/download_file?file_path=${WSO2_SERVER}.zip # build arguments for external artifacts diff --git a/dockerfiles/centos/is-analytics/dashboard/Dockerfile b/dockerfiles/centos/is-analytics/dashboard/Dockerfile index 2bcd6ca8..4b52ffb7 100644 --- a/dockerfiles/centos/is-analytics/dashboard/Dockerfile +++ b/dockerfiles/centos/is-analytics/dashboard/Dockerfile @@ -61,7 +61,6 @@ ARG USER_HOME=/home/${USER} # build arguments for WSO2 product installation ARG WSO2_SERVER_NAME=wso2is-analytics ARG WSO2_SERVER_VERSION=5.8.0 -ARG WSO2_SERVER_REPOSITORY=product-is ARG WSO2_SERVER=${WSO2_SERVER_NAME}-${WSO2_SERVER_VERSION} ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER} ARG WSO2_SERVER_DIST_URL=https://bintray.com/wso2/binaryGA/download_file?file_path=${WSO2_SERVER}.zip diff --git a/dockerfiles/centos/is-analytics/worker/Dockerfile b/dockerfiles/centos/is-analytics/worker/Dockerfile index db4e08fb..327b84e8 100644 --- a/dockerfiles/centos/is-analytics/worker/Dockerfile +++ b/dockerfiles/centos/is-analytics/worker/Dockerfile @@ -61,7 +61,6 @@ ARG USER_HOME=/home/${USER} # build arguments for WSO2 product installation ARG WSO2_SERVER_NAME=wso2is-analytics ARG WSO2_SERVER_VERSION=5.8.0 -ARG WSO2_SERVER_REPOSITORY=product-is ARG WSO2_SERVER=${WSO2_SERVER_NAME}-${WSO2_SERVER_VERSION} ARG WSO2_SERVER_HOME=${USER_HOME}/${WSO2_SERVER} ARG WSO2_SERVER_DIST_URL=https://bintray.com/wso2/binaryGA/download_file?file_path=${WSO2_SERVER}.zip From cc7c860aa19b179ecf2b498453b24ec16a294c85 Mon Sep 17 00:00:00 2001 From: Yoshani Date: Wed, 1 Feb 2023 16:33:30 +0530 Subject: [PATCH 09/13] Upgrade jdk version --- .../alpine/is-analytics/dashboard/Dockerfile | 60 ++---------------- .../alpine/is-analytics/worker/Dockerfile | 62 ++----------------- 2 files changed, 9 insertions(+), 113 deletions(-) diff --git a/dockerfiles/alpine/is-analytics/dashboard/Dockerfile b/dockerfiles/alpine/is-analytics/dashboard/Dockerfile index b880b206..b79148d8 100644 --- a/dockerfiles/alpine/is-analytics/dashboard/Dockerfile +++ b/dockerfiles/alpine/is-analytics/dashboard/Dockerfile @@ -16,58 +16,10 @@ # # ------------------------------------------------------------------------ -# Set base Docker image to Alpine Docker image. -FROM alpine:3.15.0 +# set base Docker image to AdoptOpenJDK Alpine Docker image +FROM adoptopenjdk/openjdk8:jdk8u362-b09-alpine LABEL maintainer="WSO2 Docker Maintainers " \ com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.0.10" -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 jdk8u362-b09 - -RUN apk --no-progress --purge --no-cache upgrade \ -&& apk --no-progress --purge --no-cache add --upgrade \ - curl \ - wget \ - openssh \ -&& apk --no-progress --purge --no-cache upgrade \ -&& rm -vrf /var/cache/apk/* \ -&& curl --version - -RUN curl -o /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \ -&& curl -LO https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.32-r0/glibc-2.32-r0.apk \ -&& apk add glibc-2.32-r0.apk - -#Install JDK8. -RUN set -eux; \ - apk add --no-cache --virtual .fetch-deps curl; \ - ARCH="$(apk --print-arch)"; \ - case "${ARCH}" in \ - amd64|x86_64) \ - ESUM='389c0d2ea59742103f46f1dd6d2c83e43e9f935f3f0485b1f9e74ac4e8c5ce47'; \ - BINARY_URL='https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u362-b09/OpenJDK8U-jdk_x64_alpine-linux_hotspot_8u362b09.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" ENV=${USER_HOME}"/.ashrc" # set Docker image build arguments # build arguments for user/group configurations @@ -102,11 +54,7 @@ RUN \ # copy init script to user home COPY --chown=wso2carbon:wso2 docker-entrypoint.sh ${USER_HOME}/ # install required packages -RUN \ - apk update \ - && apk add --no-cache netcat-openbsd \ - && apk add unzip \ - && apk add wget +RUN apk add --no-cache netcat-openbsd # add the WSO2 product distribution to user's home directory RUN \ wget -O ${WSO2_SERVER}.zip "${WSO2_SERVER_DIST_URL}" \ @@ -128,4 +76,4 @@ ENV WORKING_DIRECTORY=${USER_HOME} \ EXPOSE 9643 # initiate container and start WSO2 Carbon server -ENTRYPOINT ["/home/wso2carbon/docker-entrypoint.sh"] +ENTRYPOINT ["/home/wso2carbon/docker-entrypoint.sh"] \ No newline at end of file diff --git a/dockerfiles/alpine/is-analytics/worker/Dockerfile b/dockerfiles/alpine/is-analytics/worker/Dockerfile index 8e2bd989..7f079263 100644 --- a/dockerfiles/alpine/is-analytics/worker/Dockerfile +++ b/dockerfiles/alpine/is-analytics/worker/Dockerfile @@ -16,58 +16,10 @@ # # ------------------------------------------------------------------------ -# Set base Docker image to Alpine Docker image. -FROM alpine:3.15.0 +# set base Docker image to AdoptOpenJDK Alpine Docker image +FROM adoptopenjdk/openjdk8:jdk8u362-b09-alpine LABEL maintainer="WSO2 Docker Maintainers " \ - com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.0.10" -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 jdk8u362-b09 - -RUN apk --no-progress --purge --no-cache upgrade \ -&& apk --no-progress --purge --no-cache add --upgrade \ - curl \ - wget \ - openssh \ -&& apk --no-progress --purge --no-cache upgrade \ -&& rm -vrf /var/cache/apk/* \ -&& curl --version - -RUN curl -o /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \ -&& curl -LO https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.32-r0/glibc-2.32-r0.apk \ -&& apk add glibc-2.32-r0.apk - -#Install JDK8. -RUN set -eux; \ - apk add --no-cache --virtual .fetch-deps curl; \ - ARCH="$(apk --print-arch)"; \ - case "${ARCH}" in \ - amd64|x86_64) \ - ESUM='389c0d2ea59742103f46f1dd6d2c83e43e9f935f3f0485b1f9e74ac4e8c5ce47'; \ - BINARY_URL='https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u362-b09/OpenJDK8U-jdk_x64_alpine-linux_hotspot_8u362b09.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" ENV=${USER_HOME}"/.ashrc" + com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.0.7" # set Docker image build arguments # build arguments for user/group configurations @@ -102,11 +54,7 @@ RUN \ # copy init script to user home COPY --chown=wso2carbon:wso2 docker-entrypoint.sh ${USER_HOME}/ # install required packages -RUN \ - apk update \ - && apk add --no-cache netcat-openbsd \ - && apk add unzip \ - && apk add wget +RUN apk add --no-cache netcat-openbsd # add the WSO2 product distribution to user's home directory RUN \ wget -O ${WSO2_SERVER}.zip "${WSO2_SERVER_DIST_URL}" \ @@ -128,4 +76,4 @@ ENV WORKING_DIRECTORY=${USER_HOME} \ EXPOSE 9090 9091 9443 7712 7612 9612 9712 # initiate container and start WSO2 Carbon server -ENTRYPOINT ["/home/wso2carbon/docker-entrypoint.sh"] +ENTRYPOINT ["/home/wso2carbon/docker-entrypoint.sh"] \ No newline at end of file From ab890ba2f07b9ba5497e659b8a87961e79cba221 Mon Sep 17 00:00:00 2001 From: Yoshani Date: Wed, 1 Feb 2023 16:34:29 +0530 Subject: [PATCH 10/13] Update tag --- dockerfiles/alpine/is-analytics/worker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerfiles/alpine/is-analytics/worker/Dockerfile b/dockerfiles/alpine/is-analytics/worker/Dockerfile index 7f079263..fa97f2f7 100644 --- a/dockerfiles/alpine/is-analytics/worker/Dockerfile +++ b/dockerfiles/alpine/is-analytics/worker/Dockerfile @@ -19,7 +19,7 @@ # set base Docker image to AdoptOpenJDK Alpine Docker image FROM adoptopenjdk/openjdk8:jdk8u362-b09-alpine LABEL maintainer="WSO2 Docker Maintainers " \ - com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.0.7" + com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.8.0.10" # set Docker image build arguments # build arguments for user/group configurations From d7b061b7c18d3165a8c9bf6af443b26937bfb393 Mon Sep 17 00:00:00 2001 From: Yoshani Date: Wed, 1 Feb 2023 16:39:16 +0530 Subject: [PATCH 11/13] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f5616182..26f50f4e 100644 --- a/README.md +++ b/README.md @@ -14,4 +14,4 @@ Docker Compose files have been created according to the most common IAM deployme to quickly evaluate product features along side their co-operate IAM requirements. The Compose files make use of per profile Docker images of WSO2 Identity Server and Analytics and MySQL. -**Change log** from previous v5.8.0.3 release: [View Here](CHANGELOG.md) +**Change log** from previous v5.8.0.9 release: [View Here](CHANGELOG.md) From 44b268e27a0386bb931f4d3fa652c9bdfefbf988 Mon Sep 17 00:00:00 2001 From: Yoshani Date: Wed, 1 Feb 2023 17:32:05 +0530 Subject: [PATCH 12/13] Update CHANGELOG.md --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f99d0070..8b29c1e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,10 +3,10 @@ All notable changes to this project 5.8.x per each release will be documented in The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -## [v5.8.0.10] - 2023-01-31 +## [v5.8.0.10] - 2023-02-01 ### Changed -- Update base image of dockerfiles to an OS image and installed relevant JDK on it, instead of using a JDK installed OS image. +- Modified centos dockerfiles to have OS based base image and upgraded JDK 8 version in all dockerfiles. ## [v5.8.0.9] - 2022-04-28 From 71928d0501732573b1910536afbb894edc353880 Mon Sep 17 00:00:00 2001 From: Yoshani Date: Wed, 1 Feb 2023 17:32:29 +0530 Subject: [PATCH 13/13] Add extra line --- dockerfiles/alpine/is-analytics/dashboard/Dockerfile | 2 +- dockerfiles/alpine/is-analytics/worker/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dockerfiles/alpine/is-analytics/dashboard/Dockerfile b/dockerfiles/alpine/is-analytics/dashboard/Dockerfile index b79148d8..edb3b969 100644 --- a/dockerfiles/alpine/is-analytics/dashboard/Dockerfile +++ b/dockerfiles/alpine/is-analytics/dashboard/Dockerfile @@ -76,4 +76,4 @@ ENV WORKING_DIRECTORY=${USER_HOME} \ EXPOSE 9643 # initiate container and start WSO2 Carbon server -ENTRYPOINT ["/home/wso2carbon/docker-entrypoint.sh"] \ No newline at end of file +ENTRYPOINT ["/home/wso2carbon/docker-entrypoint.sh"] diff --git a/dockerfiles/alpine/is-analytics/worker/Dockerfile b/dockerfiles/alpine/is-analytics/worker/Dockerfile index fa97f2f7..77d605ac 100644 --- a/dockerfiles/alpine/is-analytics/worker/Dockerfile +++ b/dockerfiles/alpine/is-analytics/worker/Dockerfile @@ -76,4 +76,4 @@ ENV WORKING_DIRECTORY=${USER_HOME} \ EXPOSE 9090 9091 9443 7712 7612 9612 9712 # initiate container and start WSO2 Carbon server -ENTRYPOINT ["/home/wso2carbon/docker-entrypoint.sh"] \ No newline at end of file +ENTRYPOINT ["/home/wso2carbon/docker-entrypoint.sh"]