Skip to content

Commit

Permalink
Merge pull request #330 from gershom96/5.10.x-dockerfile
Browse files Browse the repository at this point in the history
[5.10.x] Modified Dockerfiles to have OS based base image and adoptium JDK 8 and 11 for IS
  • Loading branch information
RidmiR authored Mar 9, 2022
2 parents c495408 + 7f070c8 commit cda416e
Show file tree
Hide file tree
Showing 7 changed files with 250 additions and 35 deletions.
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [v5.10.0.14] - 2022-03-09

### Changed
- Changed base image of dockerfiles to an OS image and installed relevant JDK on it, instead of using a JDK installed OS image.

## [v5.10.0.13] - 2022-01-20

### Changed
Expand Down Expand Up @@ -69,8 +74,17 @@ For detailed information on the tasks carried out during this release, please se
For detailed information on the tasks carried out during this release, please see the GitHub milestone
[v5.10.0.1](https://github.com/wso2/docker-is/milestone/10).

[v5.10.0.14]: https://github.com/wso2/docker-is/compare/v5.10.0.13...v5.10.0.14
[v5.10.0.13]: https://github.com/wso2/docker-is/compare/v5.10.0.12...v5.10.0.13
[v5.10.0.12]: https://github.com/wso2/docker-is/compare/v5.10.0.11...v5.10.0.12
[v5.10.0.11]: https://github.com/wso2/docker-is/compare/v5.10.0.10...v5.10.0.11
[v5.10.0.10]: https://github.com/wso2/docker-is/compare/v5.10.0.9...v5.10.0.10
[v5.10.0.9]: https://github.com/wso2/docker-is/compare/v5.10.0.8...v5.10.0.9
[v5.10.0.8]: https://github.com/wso2/docker-is/compare/v5.10.0.7...v5.10.0.8
[v5.10.0.7]: https://github.com/wso2/docker-is/compare/v5.10.0.6...v5.10.0.7
[v5.10.0.6]: https://github.com/wso2/docker-is/compare/v5.10.0.5...v5.10.0.6
[v5.10.0.5]: https://github.com/wso2/docker-is/compare/v5.10.0.4...v5.10.0.5
[v5.10.0.4]: https://github.com/wso2/docker-is/compare/v5.10.0.3...v5.10.0.4
[v5.10.0.4]: https://github.com/wso2/docker-is/compare/v5.10.0.4...v5.10.0.4
[v5.10.0.3]: https://github.com/wso2/docker-is/compare/v5.10.0.2...v5.10.0.3
[v5.10.0.2]: https://github.com/wso2/docker-is/compare/v5.10.0.1...v5.10.0.2
[v5.10.0.1]: https://github.com/wso2/docker-is/compare/v5.9.0.3...v5.10.0.1
52 changes: 45 additions & 7 deletions dockerfiles/alpine/is/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand All @@ -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 \
Expand All @@ -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
Expand Down
46 changes: 42 additions & 4 deletions dockerfiles/centos/is/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}/
Expand Down
63 changes: 57 additions & 6 deletions dockerfiles/jdk8/alpine/is/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand All @@ -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
Expand Down
45 changes: 41 additions & 4 deletions dockerfiles/jdk8/centos/is/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}/
Expand Down
41 changes: 38 additions & 3 deletions dockerfiles/jdk8/ubuntu/is/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit cda416e

Please sign in to comment.