-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #330 from gershom96/5.10.x-dockerfile
[5.10.x] Modified Dockerfiles to have OS based base image and adoptium JDK 8 and 11 for IS
- Loading branch information
Showing
7 changed files
with
250 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,10 +16,46 @@ | |
# | ||
# ------------------------------------------------------------------------ | ||
|
||
# set base Docker image to AdoptOpenJDK Alpine Docker image | ||
FROM adoptopenjdk/openjdk11:jdk-11.0.11_9-alpine | ||
# set base Docker image to Alpine Docker image | ||
FROM alpine:3.15.0 | ||
LABEL maintainer="WSO2 Docker Maintainers <[email protected]>" \ | ||
com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.10.0.12" | ||
com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.10.0.14" | ||
|
||
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 JDK11 | ||
RUN set -eux; \ | ||
apk add --no-cache --virtual .fetch-deps curl; \ | ||
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" ENV=${USER_HOME}"/.ashrc" | ||
|
||
# set Docker image build arguments | ||
# build arguments for user/group configurations | ||
|
@@ -46,7 +82,6 @@ ARG MOTD='printf "\n\ | |
This Docker container comprises of a WSO2 product, running with its latest GA release \n\ | ||
which is under the Apache License, Version 2.0. \n\ | ||
Read more about Apache License, Version 2.0 here @ http://www.apache.org/licenses/LICENSE-2.0.\n"' | ||
ENV ENV=${USER_HOME}"/.ashrc" | ||
|
||
# create the non-root user and group and set MOTD login message | ||
RUN \ | ||
|
@@ -66,7 +101,11 @@ RUN \ | |
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 \ | ||
|
@@ -86,8 +125,7 @@ USER ${USER_ID} | |
WORKDIR ${USER_HOME} | ||
|
||
# set environment variables | ||
ENV JAVA_OPTS="-Djava.util.prefs.systemRoot=${USER_HOME}/.java -Djava.util.prefs.userRoot=${USER_HOME}/.java/.userPrefs" \ | ||
WORKING_DIRECTORY=${USER_HOME} \ | ||
ENV WORKING_DIRECTORY=${USER_HOME} \ | ||
WSO2_SERVER_HOME=${WSO2_SERVER_HOME} | ||
|
||
# expose ports | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,10 +16,41 @@ | |
# | ||
# ------------------------------------------------------------------------ | ||
|
||
# set base Docker image to AdoptOpenJDK CentOS Docker image | ||
FROM adoptopenjdk/openjdk11:x86_64-centos-jdk-11.0.11_9 | ||
# set base Docker image to CentOS Docker image | ||
FROM centos:7 | ||
LABEL maintainer="WSO2 Docker Maintainers <[email protected]>" \ | ||
com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.10.0.9" | ||
com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.10.0.14" | ||
|
||
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.13+8 | ||
|
||
# Install JDK11 | ||
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='3b1c0c34be4c894e64135a454f2d5aaa4bd10aea04ec2fa0c0efe6bb26528e30'; \ | ||
BINARY_URL='https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.13%2B8/OpenJDK11U-jdk_x64_linux_hotspot_11.0.13_8.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 | ||
|
@@ -45,13 +76,20 @@ Welcome to WSO2 Docker resources.\n\ | |
------------------------------------ \n\ | ||
This Docker container comprises of a WSO2 product, running with its latest GA release \n\ | ||
which is under the Apache License, Version 2.0. \n\ | ||
Read more about Apache License, Version 2.0 here @ http://www.apache.org/licenses/LICENSE-2.0.\n\n"' | ||
Read more about Apache License, Version 2.0 here @ http://www.apache.org/licenses/LICENSE-2.0.\n"' | ||
|
||
# create the non-root user and group and set MOTD login message | ||
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}/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,10 +16,58 @@ | |
# | ||
# ------------------------------------------------------------------------ | ||
|
||
# set base Docker image to AdoptOpenJDK Alpine Docker image | ||
FROM adoptopenjdk/openjdk8:jdk8u292-b10-alpine | ||
# set base Docker image to Alpine Docker image | ||
FROM alpine:3.15.0 | ||
LABEL maintainer="WSO2 Docker Maintainers <[email protected]>" \ | ||
com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.10.0.12" | ||
com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.10.0.14" | ||
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 jdk8u322-b06 | ||
|
||
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='3d62362a78c9412766471b05253507a4cfc212daea5cdf122860173ce902400e'; \ | ||
BINARY_URL='https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u322-b06/OpenJDK8U-jdk_x64_linux_hotspot_8u322b06.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 | ||
|
@@ -66,7 +114,11 @@ RUN \ | |
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 \ | ||
|
@@ -86,8 +138,7 @@ USER ${USER_ID} | |
WORKDIR ${USER_HOME} | ||
|
||
# set environment variables | ||
ENV JAVA_OPTS="-Djava.util.prefs.systemRoot=${USER_HOME}/.java -Djava.util.prefs.userRoot=${USER_HOME}/.java/.userPrefs" \ | ||
WORKING_DIRECTORY=${USER_HOME} \ | ||
ENV WORKING_DIRECTORY=${USER_HOME} \ | ||
WSO2_SERVER_HOME=${WSO2_SERVER_HOME} | ||
|
||
# expose ports | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,10 +16,40 @@ | |
# | ||
# ------------------------------------------------------------------------ | ||
|
||
# set base Docker image to AdoptOpenJDK CentOS Docker image | ||
FROM adoptopenjdk/openjdk8:jdk8u292-b10-centos | ||
# set base Docker image to CentOS Docker image | ||
FROM centos:7 | ||
LABEL maintainer="WSO2 Docker Maintainers <[email protected]>" \ | ||
com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.10.0.12" | ||
com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.10.0.14" | ||
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' | ||
|
||
# Instal JDK Dependencies | ||
RUN yum install -y tzdata openssl curl ca-certificates fontconfig gzip tar \ | ||
&& yum clean all | ||
|
||
ENV JAVA_VERSION jdk8u322-b06 | ||
|
||
# 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='3d62362a78c9412766471b05253507a4cfc212daea5cdf122860173ce902400e'; \ | ||
BINARY_URL='https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u322-b06/OpenJDK8U-jdk_x64_linux_hotspot_8u322b06.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 | ||
|
@@ -45,13 +75,20 @@ Welcome to WSO2 Docker resources.\n\ | |
------------------------------------ \n\ | ||
This Docker container comprises of a WSO2 product, running with its latest GA release \n\ | ||
which is under the Apache License, Version 2.0. \n\ | ||
Read more about Apache License, Version 2.0 here @ http://www.apache.org/licenses/LICENSE-2.0.\n\n"' | ||
Read more about Apache License, Version 2.0 here @ http://www.apache.org/licenses/LICENSE-2.0.\n"' | ||
|
||
# create the non-root user and group and set MOTD login message | ||
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}/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,10 +16,45 @@ | |
# | ||
# ------------------------------------------------------------------------ | ||
|
||
# set base Docker image to AdoptOpenJDK Ubuntu Docker image | ||
FROM adoptopenjdk:8u292-b10-jdk-hotspot-focal | ||
# set base Docker image to Ubuntu 20.04 Docker image | ||
FROM ubuntu:20.04 | ||
|
||
LABEL maintainer="WSO2 Docker Maintainers <[email protected]>" \ | ||
com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.10.0.12" | ||
com.wso2.docker.source="https://github.com/wso2/docker-is/releases/tag/v5.10.0.14" | ||
|
||
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' | ||
|
||
#Install JDK Dependencies | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends tzdata curl ca-certificates fontconfig locales \ | ||
&& 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 jdk8u322-b06 | ||
|
||
#Install JDK8 | ||
RUN set -eux; \ | ||
ARCH="$(dpkg --print-architecture)"; \ | ||
case "${ARCH}" in \ | ||
amd64|x86_64) \ | ||
ESUM='3d62362a78c9412766471b05253507a4cfc212daea5cdf122860173ce902400e'; \ | ||
BINARY_URL='https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u322-b06/OpenJDK8U-jdk_x64_linux_hotspot_8u322b06.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 | ||
|
Oops, something went wrong.