Skip to content

Commit

Permalink
Merge pull request #429 from PasanT9/3.2.x-apim
Browse files Browse the repository at this point in the history
[APIM] [3.2.x] Modify Docker images to use base OS image and build Temurin OpenJDK
  • Loading branch information
tgtshanika authored Mar 4, 2022
2 parents bc0444a + f9d08e6 commit 4103840
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 16 deletions.
48 changes: 45 additions & 3 deletions dockerfiles/alpine/apim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,52 @@
#
# ------------------------------------------------------------------------

# set base Docker image to AdoptOpenJDK Alpine Docker image
FROM adoptopenjdk/openjdk11:jdk-11.0.10_9-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 <dev@wso2.org>" \
com.wso2.docker.source="https://github.com/wso2/docker-apim/releases/tag/v3.2.0.2"
com.wso2.docker.source="https://github.com/wso2/docker-apim/releases/tag/v3.2.0.3"

# set Docker image build arguments
# build arguments for user/group configurations
Expand Down
52 changes: 49 additions & 3 deletions dockerfiles/centos/apim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,56 @@
#
# ------------------------------------------------------------------------

# set base Docker image to AdoptOpenJDK CentOS Docker image
FROM adoptopenjdk/openjdk11:x86_64-centos-jdk-11.0.10_9
# 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 <dev@wso2.org>" \
com.wso2.docker.source="https://github.com/wso2/docker-apim/releases/tag/v3.2.0.3"
com.wso2.docker.source="https://github.com/wso2/docker-apim/releases/tag/v3.2.0.4"
# set Docker image build arguments
# build arguments for user/group configurations
ARG USER=wso2carbon
Expand Down
44 changes: 34 additions & 10 deletions dockerfiles/ubuntu/apim/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,43 @@
#
# ------------------------------------------------------------------------

# set base Docker image to JDK Ubuntu 20.04 Docker image
# set base Docker image to Ubuntu Focal Docker image
FROM ubuntu:20.04
LABEL maintainer="WSO2 Docker Maintainers <dev@wso2.org>" \
com.wso2.docker.source="https://github.com/wso2/docker-apim/releases/tag/v3.2.0.3"

#Install Open JDK
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 \
&& 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.13+8
ENV JAVA_VERSION jdk-11.0.14+9

# install OpenJDK 11
RUN set -eux; \
ARCH="$(dpkg --print-architecture)"; \
case "${ARCH}" in \
amd64|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'; \
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}"; \
Expand All @@ -54,6 +69,15 @@ RUN set -eux; \
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 <dev@wso2.org>" \
com.wso2.docker.source="https://github.com/wso2/docker-apim/releases/tag/v3.2.0.4"

# set Docker image build arguments
# build arguments for user/group configurations
ARG USER=wso2carbon
Expand Down Expand Up @@ -117,4 +141,4 @@ ENV WORKING_DIRECTORY=${USER_HOME} \
EXPOSE 9763 9443 9999 11111 8280 8243 5672 9711 9611 9099

# initiate container and start WSO2 Carbon server
ENTRYPOINT ["/home/wso2carbon/docker-entrypoint.sh"]
ENTRYPOINT ["/home/wso2carbon/docker-entrypoint.sh"]

0 comments on commit 4103840

Please sign in to comment.