From 266a6ef4a5d510c48229f3d92cee5bc7855b3a31 Mon Sep 17 00:00:00 2001 From: eclipse-temurin-bot Date: Wed, 27 Mar 2024 15:32:44 +0000 Subject: [PATCH] dockerfile: automated nightly updates --- 22/jdk/alpine/Dockerfile | 84 ++++++++++++++++ 22/jdk/alpine/entrypoint.sh | 30 ++++++ 22/jdk/ubi/ubi9-minimal/Dockerfile | 89 +++++++++++++++++ 22/jdk/ubi/ubi9-minimal/entrypoint.sh | 30 ++++++ 22/jdk/ubuntu/jammy/Dockerfile | 98 +++++++++++++++++++ 22/jdk/ubuntu/jammy/entrypoint.sh | 30 ++++++ 22/jdk/windows/nanoserver-1809/Dockerfile | 41 ++++++++ 22/jdk/windows/nanoserver-ltsc2022/Dockerfile | 41 ++++++++ .../windows/windowsservercore-1809/Dockerfile | 56 +++++++++++ .../windowsservercore-ltsc2022/Dockerfile | 56 +++++++++++ 22/jre/alpine/Dockerfile | 77 +++++++++++++++ 22/jre/alpine/entrypoint.sh | 30 ++++++ 22/jre/ubi/ubi9-minimal/Dockerfile | 85 ++++++++++++++++ 22/jre/ubi/ubi9-minimal/entrypoint.sh | 30 ++++++ 22/jre/ubuntu/jammy/Dockerfile | 91 +++++++++++++++++ 22/jre/ubuntu/jammy/entrypoint.sh | 30 ++++++ 22/jre/windows/nanoserver-1809/Dockerfile | 38 +++++++ 22/jre/windows/nanoserver-ltsc2022/Dockerfile | 38 +++++++ .../windows/windowsservercore-1809/Dockerfile | 53 ++++++++++ .../windowsservercore-ltsc2022/Dockerfile | 53 ++++++++++ 20 files changed, 1080 insertions(+) create mode 100644 22/jdk/alpine/Dockerfile create mode 100755 22/jdk/alpine/entrypoint.sh create mode 100644 22/jdk/ubi/ubi9-minimal/Dockerfile create mode 100755 22/jdk/ubi/ubi9-minimal/entrypoint.sh create mode 100644 22/jdk/ubuntu/jammy/Dockerfile create mode 100755 22/jdk/ubuntu/jammy/entrypoint.sh create mode 100644 22/jdk/windows/nanoserver-1809/Dockerfile create mode 100644 22/jdk/windows/nanoserver-ltsc2022/Dockerfile create mode 100644 22/jdk/windows/windowsservercore-1809/Dockerfile create mode 100644 22/jdk/windows/windowsservercore-ltsc2022/Dockerfile create mode 100644 22/jre/alpine/Dockerfile create mode 100755 22/jre/alpine/entrypoint.sh create mode 100644 22/jre/ubi/ubi9-minimal/Dockerfile create mode 100755 22/jre/ubi/ubi9-minimal/entrypoint.sh create mode 100644 22/jre/ubuntu/jammy/Dockerfile create mode 100755 22/jre/ubuntu/jammy/entrypoint.sh create mode 100644 22/jre/windows/nanoserver-1809/Dockerfile create mode 100644 22/jre/windows/nanoserver-ltsc2022/Dockerfile create mode 100644 22/jre/windows/windowsservercore-1809/Dockerfile create mode 100644 22/jre/windows/windowsservercore-ltsc2022/Dockerfile diff --git a/22/jdk/alpine/Dockerfile b/22/jdk/alpine/Dockerfile new file mode 100644 index 000000000..5a1eba352 --- /dev/null +++ b/22/jdk/alpine/Dockerfile @@ -0,0 +1,84 @@ +# ------------------------------------------------------------------------------ +# NOTE: THIS DOCKERFILE IS GENERATED VIA "generate_dockerfiles.py" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# ------------------------------------------------------------------------------ +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +FROM alpine:3.19 + +ENV JAVA_HOME /opt/java/openjdk +ENV PATH $JAVA_HOME/bin:$PATH + +# Default to UTF-8 file.encoding +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' + +RUN set -eux; \ + apk add --no-cache \ + # java.lang.UnsatisfiedLinkError: libfontmanager.so: libfreetype.so.6: cannot open shared object file: No such file or directory + # java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11FontManager + # https://github.com/docker-library/openjdk/pull/235#issuecomment-424466077 + fontconfig ttf-dejavu \ + # utilities for keeping Alpine and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates p11-kit-trust \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + musl-locales musl-locales-lang \ + # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 + # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory + binutils \ + tzdata \ + ; \ + rm -rf /var/cache/apk/* + +ENV JAVA_VERSION jdk-22+36 + +RUN set -eux; \ + ARCH="$(apk --print-arch)"; \ + case "${ARCH}" in \ + aarch64|arm64) \ + ESUM='e6c97db54afe145a8f93f9ca728b4df8a0490a45f0f999999c7464c64612e936'; \ + BINARY_URL='https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22%2B36/OpenJDK22U-jdk_aarch64_alpine-linux_hotspot_22_36.tar.gz'; \ + ;; \ + amd64|x86_64) \ + ESUM='f88fbe6360276cc9aec406802838ff0cfb368e08c2b1cf7b6fa78a846266a7af'; \ + BINARY_URL='https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22%2B36/OpenJDK22U-jdk_x64_alpine-linux_hotspot_22_36.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 "$JAVA_HOME"; \ + tar --extract \ + --file /tmp/openjdk.tar.gz \ + --directory "$JAVA_HOME" \ + --strip-components 1 \ + --no-same-owner \ + ; \ + rm -f /tmp/openjdk.tar.gz ${JAVA_HOME}/lib/src.zip; + +RUN set -eux; \ + echo "Verifying install ..."; \ + fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ + echo "javac --version"; javac --version; \ + echo "java --version"; java --version; \ + echo "Complete." +COPY entrypoint.sh /__cacert_entrypoint.sh +ENTRYPOINT ["/__cacert_entrypoint.sh"] + +CMD ["jshell"] diff --git a/22/jdk/alpine/entrypoint.sh b/22/jdk/alpine/entrypoint.sh new file mode 100755 index 000000000..029cade7e --- /dev/null +++ b/22/jdk/alpine/entrypoint.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env sh +# Converted to POSIX shell to avoid the need for bash in the image + +set -e + +# Opt-in is only activated if the environment variable is set +if [ -n "$USE_SYSTEM_CA_CERTS" ]; then + + # Copy certificates from /certificates to the system truststore, but only if the directory exists and is not empty. + # The reason why this is not part of the opt-in is because it leaves open the option to mount certificates at the + # system location, for whatever reason. + if [ -d /certificates ] && [ -n "$(ls -A /certificates 2>/dev/null)" ]; then + cp -a /certificates/* /usr/local/share/ca-certificates/ + fi + + CACERT="$JAVA_HOME/lib/security/cacerts" + + # JDK8 puts its JRE in a subdirectory + if [ -f "$JAVA_HOME/jre/lib/security/cacerts" ]; then + CACERT="$JAVA_HOME/jre/lib/security/cacerts" + fi + + # OpenJDK images used to create a hook for `update-ca-certificates`. Since we are using an entrypoint anyway, we + # might as well just generate the truststore and skip the hooks. + update-ca-certificates + + trust extract --overwrite --format=java-cacerts --filter=ca-anchors --purpose=server-auth "$CACERT" +fi + +exec "$@" diff --git a/22/jdk/ubi/ubi9-minimal/Dockerfile b/22/jdk/ubi/ubi9-minimal/Dockerfile new file mode 100644 index 000000000..14f0d101d --- /dev/null +++ b/22/jdk/ubi/ubi9-minimal/Dockerfile @@ -0,0 +1,89 @@ +# ------------------------------------------------------------------------------ +# NOTE: THIS DOCKERFILE IS GENERATED VIA "generate_dockerfiles.py" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# ------------------------------------------------------------------------------ +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +FROM redhat/ubi9-minimal + +ENV JAVA_HOME /opt/java/openjdk +ENV PATH $JAVA_HOME/bin:$PATH + +# Default to UTF-8 file.encoding +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' + +RUN set -eux; \ + microdnf install -y \ + gzip \ + tar \ + # Required for objdump and also jlink + binutils \ + tzdata \ + wget \ + # utilities for keeping UBI and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates \ + # java.lang.UnsatisfiedLinkError: libfontmanager.so: libfreetype.so.6: cannot open shared object file: No such file or directory + # java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11FontManager + # https://github.com/docker-library/openjdk/pull/235#issuecomment-424466077 + fontconfig \ + glibc-langpack-en \ + ; \ + microdnf clean all + +ENV JAVA_VERSION jdk-22+36 + +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='4b52670caea44848cee893e35c804380817b6eff166cf64ee70ca2bfaac3d1c7'; \ + BINARY_URL='https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22%2B36/OpenJDK22U-jdk_aarch64_linux_hotspot_22_36.tar.gz'; \ + ;; \ + amd64|i386:x86-64) \ + ESUM='bc3d99e816d0c373f424cd7aa2b6d3e8081a7189fe55c1561616922200ec8e47'; \ + BINARY_URL='https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22%2B36/OpenJDK22U-jdk_x64_linux_hotspot_22_36.tar.gz'; \ + ;; \ + ppc64el|powerpc:common64) \ + ESUM='8c062e934d95c639f97b4e51b968eed694a6653248727c3db8bc5e0e55cfd7f4'; \ + BINARY_URL='https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22%2B36/OpenJDK22U-jdk_ppc64le_linux_hotspot_22_36.tar.gz'; \ + ;; \ + *) \ + echo "Unsupported arch: ${ARCH}"; \ + exit 1; \ + ;; \ + esac; \ + wget --progress=dot:giga -O /tmp/openjdk.tar.gz ${BINARY_URL}; \ + echo "${ESUM} */tmp/openjdk.tar.gz" | sha256sum -c -; \ + mkdir -p "$JAVA_HOME"; \ + tar --extract \ + --file /tmp/openjdk.tar.gz \ + --directory "$JAVA_HOME" \ + --strip-components 1 \ + --no-same-owner \ + ; \ + rm -f /tmp/openjdk.tar.gz ${JAVA_HOME}/lib/src.zip; + +RUN set -eux; \ + echo "Verifying install ..."; \ + fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ + echo "javac --version"; javac --version; \ + echo "java --version"; java --version; \ + echo "Complete." +COPY entrypoint.sh /__cacert_entrypoint.sh +ENTRYPOINT ["/__cacert_entrypoint.sh"] + +CMD ["jshell"] diff --git a/22/jdk/ubi/ubi9-minimal/entrypoint.sh b/22/jdk/ubi/ubi9-minimal/entrypoint.sh new file mode 100755 index 000000000..481ab8862 --- /dev/null +++ b/22/jdk/ubi/ubi9-minimal/entrypoint.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# Shebang needs to be `bash`, see https://github.com/adoptium/containers/issues/415 for details + +set -e + +# Opt-in is only activated if the environment variable is set +if [ -n "$USE_SYSTEM_CA_CERTS" ]; then + + # Copy certificates from /certificates to the system truststore, but only if the directory exists and is not empty. + # The reason why this is not part of the opt-in is because it leaves open the option to mount certificates at the + # system location, for whatever reason. + if [ -d /certificates ] && [ "$(ls -A /certificates)" ]; then + cp -a /certificates/* /usr/share/pki/ca-trust-source/anchors/ + fi + + CACERT=$JAVA_HOME/lib/security/cacerts + + # JDK8 puts its JRE in a subdirectory + if [ -f "$JAVA_HOME/jre/lib/security/cacerts" ]; then + CACERT=$JAVA_HOME/jre/lib/security/cacerts + fi + + # RHEL-based images already include a routine to update a java truststore from the system CA bundle within + # `update-ca-trust`. All we need to do is to link the system CA bundle to the java truststore. + update-ca-trust + + ln -sf /etc/pki/ca-trust/extracted/java/cacerts "$CACERT" +fi + +exec "$@" diff --git a/22/jdk/ubuntu/jammy/Dockerfile b/22/jdk/ubuntu/jammy/Dockerfile new file mode 100644 index 000000000..98b4af7a5 --- /dev/null +++ b/22/jdk/ubuntu/jammy/Dockerfile @@ -0,0 +1,98 @@ +# ------------------------------------------------------------------------------ +# NOTE: THIS DOCKERFILE IS GENERATED VIA "generate_dockerfiles.py" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# ------------------------------------------------------------------------------ +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +FROM ubuntu:22.04 + +ENV JAVA_HOME /opt/java/openjdk +ENV PATH $JAVA_HOME/bin:$PATH + +# Default to UTF-8 file.encoding +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' + +RUN set -eux; \ + apt-get update; \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + wget \ + # java.lang.UnsatisfiedLinkError: libfontmanager.so: libfreetype.so.6: cannot open shared object file: No such file or directory + # java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11FontManager + # https://github.com/docker-library/openjdk/pull/235#issuecomment-424466077 + fontconfig \ + # utilities for keeping Ubuntu and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates p11-kit \ + # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351 + # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory + binutils \ + tzdata \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + 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 jdk-22+36 + +RUN set -eux; \ + ARCH="$(dpkg --print-architecture)"; \ + case "${ARCH}" in \ + aarch64|arm64) \ + ESUM='4b52670caea44848cee893e35c804380817b6eff166cf64ee70ca2bfaac3d1c7'; \ + BINARY_URL='https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22%2B36/OpenJDK22U-jdk_aarch64_linux_hotspot_22_36.tar.gz'; \ + ;; \ + amd64|i386:x86-64) \ + ESUM='bc3d99e816d0c373f424cd7aa2b6d3e8081a7189fe55c1561616922200ec8e47'; \ + BINARY_URL='https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22%2B36/OpenJDK22U-jdk_x64_linux_hotspot_22_36.tar.gz'; \ + ;; \ + ppc64el|powerpc:common64) \ + ESUM='8c062e934d95c639f97b4e51b968eed694a6653248727c3db8bc5e0e55cfd7f4'; \ + BINARY_URL='https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22%2B36/OpenJDK22U-jdk_ppc64le_linux_hotspot_22_36.tar.gz'; \ + ;; \ + *) \ + echo "Unsupported arch: ${ARCH}"; \ + exit 1; \ + ;; \ + esac; \ + wget --progress=dot:giga -O /tmp/openjdk.tar.gz ${BINARY_URL}; \ + echo "${ESUM} */tmp/openjdk.tar.gz" | sha256sum -c -; \ + mkdir -p "$JAVA_HOME"; \ + tar --extract \ + --file /tmp/openjdk.tar.gz \ + --directory "$JAVA_HOME" \ + --strip-components 1 \ + --no-same-owner \ + ; \ + rm -f /tmp/openjdk.tar.gz ${JAVA_HOME}/lib/src.zip; \ + # https://github.com/docker-library/openjdk/issues/331#issuecomment-498834472 + find "$JAVA_HOME/lib" -name '*.so' -exec dirname '{}' ';' | sort -u > /etc/ld.so.conf.d/docker-openjdk.conf; \ + ldconfig; \ + # https://github.com/docker-library/openjdk/issues/212#issuecomment-420979840 + # https://openjdk.java.net/jeps/341 + java -Xshare:dump; + +RUN set -eux; \ + echo "Verifying install ..."; \ + fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ + echo "javac --version"; javac --version; \ + echo "java --version"; java --version; \ + echo "Complete." +COPY entrypoint.sh /__cacert_entrypoint.sh +ENTRYPOINT ["/__cacert_entrypoint.sh"] + +CMD ["jshell"] diff --git a/22/jdk/ubuntu/jammy/entrypoint.sh b/22/jdk/ubuntu/jammy/entrypoint.sh new file mode 100755 index 000000000..dfcf546f9 --- /dev/null +++ b/22/jdk/ubuntu/jammy/entrypoint.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# Sheband needs to be `bash`, see https://github.com/adoptium/containers/issues/415 for details + +set -e + +# Opt-in is only activated if the environment variable is set +if [ -n "$USE_SYSTEM_CA_CERTS" ]; then + + # Copy certificates from /certificates to the system truststore, but only if the directory exists and is not empty. + # The reason why this is not part of the opt-in is because it leaves open the option to mount certificates at the + # system location, for whatever reason. + if [ -d /certificates ] && [ "$(ls -A /certificates)" ]; then + cp -a /certificates/* /usr/local/share/ca-certificates/ + fi + + CACERT=$JAVA_HOME/lib/security/cacerts + + # JDK8 puts its JRE in a subdirectory + if [ -f "$JAVA_HOME/jre/lib/security/cacerts" ]; then + CACERT=$JAVA_HOME/jre/lib/security/cacerts + fi + + # OpenJDK images used to create a hook for `update-ca-certificates`. Since we are using an entrypoint anyway, we + # might as well just generate the truststore and skip the hooks. + update-ca-certificates + + trust extract --overwrite --format=java-cacerts --filter=ca-anchors --purpose=server-auth "$CACERT" +fi + +exec "$@" diff --git a/22/jdk/windows/nanoserver-1809/Dockerfile b/22/jdk/windows/nanoserver-1809/Dockerfile new file mode 100644 index 000000000..328fb0746 --- /dev/null +++ b/22/jdk/windows/nanoserver-1809/Dockerfile @@ -0,0 +1,41 @@ +# ------------------------------------------------------------------------------ +# NOTE: THIS DOCKERFILE IS GENERATED VIA "generate_dockerfiles.py" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# ------------------------------------------------------------------------------ +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +FROM mcr.microsoft.com/windows/nanoserver:1809 + +SHELL ["cmd", "/s", "/c"] + +ENV JAVA_VERSION jdk-22+36 + +ENV JAVA_HOME C:\\openjdk-22 +# "ERROR: Access to the registry path is denied." +USER ContainerAdministrator +RUN echo Updating PATH: %JAVA_HOME%\bin;%PATH% \ + && setx /M PATH %JAVA_HOME%\bin;%PATH% \ + && echo Complete. +USER ContainerUser + +COPY --from=eclipse-temurin:22_36-jdk-windowsservercore-1809 $JAVA_HOME $JAVA_HOME + +RUN echo Verifying install ... \ + && echo javac --version && javac --version \ + && echo java --version && java --version \ + && echo Complete. + +CMD ["jshell"] diff --git a/22/jdk/windows/nanoserver-ltsc2022/Dockerfile b/22/jdk/windows/nanoserver-ltsc2022/Dockerfile new file mode 100644 index 000000000..b96f84bc8 --- /dev/null +++ b/22/jdk/windows/nanoserver-ltsc2022/Dockerfile @@ -0,0 +1,41 @@ +# ------------------------------------------------------------------------------ +# NOTE: THIS DOCKERFILE IS GENERATED VIA "generate_dockerfiles.py" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# ------------------------------------------------------------------------------ +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +FROM mcr.microsoft.com/windows/nanoserver:ltsc2022 + +SHELL ["cmd", "/s", "/c"] + +ENV JAVA_VERSION jdk-22+36 + +ENV JAVA_HOME C:\\openjdk-22 +# "ERROR: Access to the registry path is denied." +USER ContainerAdministrator +RUN echo Updating PATH: %JAVA_HOME%\bin;%PATH% \ + && setx /M PATH %JAVA_HOME%\bin;%PATH% \ + && echo Complete. +USER ContainerUser + +COPY --from=eclipse-temurin:22_36-jdk-windowsservercore-ltsc2022 $JAVA_HOME $JAVA_HOME + +RUN echo Verifying install ... \ + && echo javac --version && javac --version \ + && echo java --version && java --version \ + && echo Complete. + +CMD ["jshell"] diff --git a/22/jdk/windows/windowsservercore-1809/Dockerfile b/22/jdk/windows/windowsservercore-1809/Dockerfile new file mode 100644 index 000000000..8c2113ed5 --- /dev/null +++ b/22/jdk/windows/windowsservercore-1809/Dockerfile @@ -0,0 +1,56 @@ +# ------------------------------------------------------------------------------ +# NOTE: THIS DOCKERFILE IS GENERATED VIA "generate_dockerfiles.py" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# ------------------------------------------------------------------------------ +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +FROM mcr.microsoft.com/windows/servercore:1809 + +# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV JAVA_VERSION jdk-22+36 + +RUN Write-Host ('Downloading https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22%2B36/OpenJDK22U-jdk_x64_windows_hotspot_22_36.msi ...'); \ + curl.exe -LfsSo openjdk.msi https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22%2B36/OpenJDK22U-jdk_x64_windows_hotspot_22_36.msi ; \ + Write-Host ('Verifying sha256 (a825f7098a99a6e6a6dca621ba58a60ec285eee19a27e641870ff7cdfd223a85) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne 'a825f7098a99a6e6a6dca621ba58a60ec285eee19a27e641870ff7cdfd223a85') { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + New-Item -ItemType Directory -Path C:\temp | Out-Null; \ + \ + Write-Host 'Installing using MSI ...'; \ + $proc = Start-Process -FilePath "msiexec.exe" -ArgumentList '/i', 'openjdk.msi', '/L*V', 'C:\temp\OpenJDK.log', \ + '/quiet', 'ADDLOCAL=FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome', 'INSTALLDIR=C:\openjdk-22' -Wait -Passthru; \ + $proc.WaitForExit() ; \ + if ($proc.ExitCode -ne 0) { \ + Write-Host 'FAILED installing MSI!' ; \ + exit 1; \ + }; \ + \ + Remove-Item -Path C:\temp -Recurse | Out-Null; \ + Write-Host 'Removing openjdk.msi ...'; \ + Remove-Item openjdk.msi -Force + +RUN Write-Host 'Verifying install ...'; \ + Write-Host 'javac --version'; javac --version; \ + Write-Host 'java --version'; java --version; \ + \ + Write-Host 'Complete.' + +CMD ["jshell"] diff --git a/22/jdk/windows/windowsservercore-ltsc2022/Dockerfile b/22/jdk/windows/windowsservercore-ltsc2022/Dockerfile new file mode 100644 index 000000000..77be87548 --- /dev/null +++ b/22/jdk/windows/windowsservercore-ltsc2022/Dockerfile @@ -0,0 +1,56 @@ +# ------------------------------------------------------------------------------ +# NOTE: THIS DOCKERFILE IS GENERATED VIA "generate_dockerfiles.py" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# ------------------------------------------------------------------------------ +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +FROM mcr.microsoft.com/windows/servercore:ltsc2022 + +# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV JAVA_VERSION jdk-22+36 + +RUN Write-Host ('Downloading https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22%2B36/OpenJDK22U-jdk_x64_windows_hotspot_22_36.msi ...'); \ + curl.exe -LfsSo openjdk.msi https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22%2B36/OpenJDK22U-jdk_x64_windows_hotspot_22_36.msi ; \ + Write-Host ('Verifying sha256 (a825f7098a99a6e6a6dca621ba58a60ec285eee19a27e641870ff7cdfd223a85) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne 'a825f7098a99a6e6a6dca621ba58a60ec285eee19a27e641870ff7cdfd223a85') { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + New-Item -ItemType Directory -Path C:\temp | Out-Null; \ + \ + Write-Host 'Installing using MSI ...'; \ + $proc = Start-Process -FilePath "msiexec.exe" -ArgumentList '/i', 'openjdk.msi', '/L*V', 'C:\temp\OpenJDK.log', \ + '/quiet', 'ADDLOCAL=FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome', 'INSTALLDIR=C:\openjdk-22' -Wait -Passthru; \ + $proc.WaitForExit() ; \ + if ($proc.ExitCode -ne 0) { \ + Write-Host 'FAILED installing MSI!' ; \ + exit 1; \ + }; \ + \ + Remove-Item -Path C:\temp -Recurse | Out-Null; \ + Write-Host 'Removing openjdk.msi ...'; \ + Remove-Item openjdk.msi -Force + +RUN Write-Host 'Verifying install ...'; \ + Write-Host 'javac --version'; javac --version; \ + Write-Host 'java --version'; java --version; \ + \ + Write-Host 'Complete.' + +CMD ["jshell"] diff --git a/22/jre/alpine/Dockerfile b/22/jre/alpine/Dockerfile new file mode 100644 index 000000000..c7636c852 --- /dev/null +++ b/22/jre/alpine/Dockerfile @@ -0,0 +1,77 @@ +# ------------------------------------------------------------------------------ +# NOTE: THIS DOCKERFILE IS GENERATED VIA "generate_dockerfiles.py" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# ------------------------------------------------------------------------------ +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +FROM alpine:3.19 + +ENV JAVA_HOME /opt/java/openjdk +ENV PATH $JAVA_HOME/bin:$PATH + +# Default to UTF-8 file.encoding +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' + +RUN set -eux; \ + apk add --no-cache \ + # java.lang.UnsatisfiedLinkError: libfontmanager.so: libfreetype.so.6: cannot open shared object file: No such file or directory + # java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11FontManager + # https://github.com/docker-library/openjdk/pull/235#issuecomment-424466077 + fontconfig ttf-dejavu \ + # utilities for keeping Alpine and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates p11-kit-trust \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + musl-locales musl-locales-lang \ + tzdata \ + ; \ + rm -rf /var/cache/apk/* + +ENV JAVA_VERSION jdk-22+36 + +RUN set -eux; \ + ARCH="$(apk --print-arch)"; \ + case "${ARCH}" in \ + aarch64|arm64) \ + ESUM='eb3885be4b9f555d70d534dc1ac22d07bbd3a9246a6c56ad69897208c2d750cc'; \ + BINARY_URL='https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22%2B36/OpenJDK22U-jre_aarch64_alpine-linux_hotspot_22_36.tar.gz'; \ + ;; \ + amd64|x86_64) \ + ESUM='9b94b27229d21b74f9484b5963fd9517561a99a98f46c3f29c4b28c311e091a3'; \ + BINARY_URL='https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22%2B36/OpenJDK22U-jre_x64_alpine-linux_hotspot_22_36.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 "$JAVA_HOME"; \ + tar --extract \ + --file /tmp/openjdk.tar.gz \ + --directory "$JAVA_HOME" \ + --strip-components 1 \ + --no-same-owner \ + ; \ + rm -f /tmp/openjdk.tar.gz ${JAVA_HOME}/lib/src.zip; + +RUN set -eux; \ + echo "Verifying install ..."; \ + echo "java --version"; java --version; \ + echo "Complete." +COPY entrypoint.sh /__cacert_entrypoint.sh +ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/22/jre/alpine/entrypoint.sh b/22/jre/alpine/entrypoint.sh new file mode 100755 index 000000000..029cade7e --- /dev/null +++ b/22/jre/alpine/entrypoint.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env sh +# Converted to POSIX shell to avoid the need for bash in the image + +set -e + +# Opt-in is only activated if the environment variable is set +if [ -n "$USE_SYSTEM_CA_CERTS" ]; then + + # Copy certificates from /certificates to the system truststore, but only if the directory exists and is not empty. + # The reason why this is not part of the opt-in is because it leaves open the option to mount certificates at the + # system location, for whatever reason. + if [ -d /certificates ] && [ -n "$(ls -A /certificates 2>/dev/null)" ]; then + cp -a /certificates/* /usr/local/share/ca-certificates/ + fi + + CACERT="$JAVA_HOME/lib/security/cacerts" + + # JDK8 puts its JRE in a subdirectory + if [ -f "$JAVA_HOME/jre/lib/security/cacerts" ]; then + CACERT="$JAVA_HOME/jre/lib/security/cacerts" + fi + + # OpenJDK images used to create a hook for `update-ca-certificates`. Since we are using an entrypoint anyway, we + # might as well just generate the truststore and skip the hooks. + update-ca-certificates + + trust extract --overwrite --format=java-cacerts --filter=ca-anchors --purpose=server-auth "$CACERT" +fi + +exec "$@" diff --git a/22/jre/ubi/ubi9-minimal/Dockerfile b/22/jre/ubi/ubi9-minimal/Dockerfile new file mode 100644 index 000000000..3770db149 --- /dev/null +++ b/22/jre/ubi/ubi9-minimal/Dockerfile @@ -0,0 +1,85 @@ +# ------------------------------------------------------------------------------ +# NOTE: THIS DOCKERFILE IS GENERATED VIA "generate_dockerfiles.py" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# ------------------------------------------------------------------------------ +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +FROM redhat/ubi9-minimal + +ENV JAVA_HOME /opt/java/openjdk +ENV PATH $JAVA_HOME/bin:$PATH + +# Default to UTF-8 file.encoding +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' + +RUN set -eux; \ + microdnf install -y \ + gzip \ + tar \ + # Required for objdump and also jlink + binutils \ + tzdata \ + wget \ + # utilities for keeping UBI and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates \ + # java.lang.UnsatisfiedLinkError: libfontmanager.so: libfreetype.so.6: cannot open shared object file: No such file or directory + # java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11FontManager + # https://github.com/docker-library/openjdk/pull/235#issuecomment-424466077 + fontconfig \ + glibc-langpack-en \ + ; \ + microdnf clean all + +ENV JAVA_VERSION jdk-22+36 + +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='4748e5024eb0251ddf0f576e4c56d21270b1f2186f62b25fc1d89c888d742ed4'; \ + BINARY_URL='https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22%2B36/OpenJDK22U-jre_aarch64_linux_hotspot_22_36.tar.gz'; \ + ;; \ + amd64|i386:x86-64) \ + ESUM='faceda94ffd16e177cb674471f29789e48378f9f190eac8523713a0cb3324be9'; \ + BINARY_URL='https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22%2B36/OpenJDK22U-jre_x64_linux_hotspot_22_36.tar.gz'; \ + ;; \ + ppc64el|powerpc:common64) \ + ESUM='e1cce04600b388777a1a278dda572a664db14cea034dc131155b3da5e6e885e5'; \ + BINARY_URL='https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22%2B36/OpenJDK22U-jre_ppc64le_linux_hotspot_22_36.tar.gz'; \ + ;; \ + *) \ + echo "Unsupported arch: ${ARCH}"; \ + exit 1; \ + ;; \ + esac; \ + wget --progress=dot:giga -O /tmp/openjdk.tar.gz ${BINARY_URL}; \ + echo "${ESUM} */tmp/openjdk.tar.gz" | sha256sum -c -; \ + mkdir -p "$JAVA_HOME"; \ + tar --extract \ + --file /tmp/openjdk.tar.gz \ + --directory "$JAVA_HOME" \ + --strip-components 1 \ + --no-same-owner \ + ; \ + rm -f /tmp/openjdk.tar.gz ${JAVA_HOME}/lib/src.zip; + +RUN set -eux; \ + echo "Verifying install ..."; \ + echo "java --version"; java --version; \ + echo "Complete." +COPY entrypoint.sh /__cacert_entrypoint.sh +ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/22/jre/ubi/ubi9-minimal/entrypoint.sh b/22/jre/ubi/ubi9-minimal/entrypoint.sh new file mode 100755 index 000000000..481ab8862 --- /dev/null +++ b/22/jre/ubi/ubi9-minimal/entrypoint.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# Shebang needs to be `bash`, see https://github.com/adoptium/containers/issues/415 for details + +set -e + +# Opt-in is only activated if the environment variable is set +if [ -n "$USE_SYSTEM_CA_CERTS" ]; then + + # Copy certificates from /certificates to the system truststore, but only if the directory exists and is not empty. + # The reason why this is not part of the opt-in is because it leaves open the option to mount certificates at the + # system location, for whatever reason. + if [ -d /certificates ] && [ "$(ls -A /certificates)" ]; then + cp -a /certificates/* /usr/share/pki/ca-trust-source/anchors/ + fi + + CACERT=$JAVA_HOME/lib/security/cacerts + + # JDK8 puts its JRE in a subdirectory + if [ -f "$JAVA_HOME/jre/lib/security/cacerts" ]; then + CACERT=$JAVA_HOME/jre/lib/security/cacerts + fi + + # RHEL-based images already include a routine to update a java truststore from the system CA bundle within + # `update-ca-trust`. All we need to do is to link the system CA bundle to the java truststore. + update-ca-trust + + ln -sf /etc/pki/ca-trust/extracted/java/cacerts "$CACERT" +fi + +exec "$@" diff --git a/22/jre/ubuntu/jammy/Dockerfile b/22/jre/ubuntu/jammy/Dockerfile new file mode 100644 index 000000000..7cdddbbc3 --- /dev/null +++ b/22/jre/ubuntu/jammy/Dockerfile @@ -0,0 +1,91 @@ +# ------------------------------------------------------------------------------ +# NOTE: THIS DOCKERFILE IS GENERATED VIA "generate_dockerfiles.py" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# ------------------------------------------------------------------------------ +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +FROM ubuntu:22.04 + +ENV JAVA_HOME /opt/java/openjdk +ENV PATH $JAVA_HOME/bin:$PATH + +# Default to UTF-8 file.encoding +ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' + +RUN set -eux; \ + apt-get update; \ + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + wget \ + # java.lang.UnsatisfiedLinkError: libfontmanager.so: libfreetype.so.6: cannot open shared object file: No such file or directory + # java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11FontManager + # https://github.com/docker-library/openjdk/pull/235#issuecomment-424466077 + fontconfig \ + # utilities for keeping Ubuntu and OpenJDK CA certificates in sync + # https://github.com/adoptium/containers/issues/293 + ca-certificates p11-kit \ + tzdata \ + # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8 + 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 jdk-22+36 + +RUN set -eux; \ + ARCH="$(dpkg --print-architecture)"; \ + case "${ARCH}" in \ + aarch64|arm64) \ + ESUM='4748e5024eb0251ddf0f576e4c56d21270b1f2186f62b25fc1d89c888d742ed4'; \ + BINARY_URL='https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22%2B36/OpenJDK22U-jre_aarch64_linux_hotspot_22_36.tar.gz'; \ + ;; \ + amd64|i386:x86-64) \ + ESUM='faceda94ffd16e177cb674471f29789e48378f9f190eac8523713a0cb3324be9'; \ + BINARY_URL='https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22%2B36/OpenJDK22U-jre_x64_linux_hotspot_22_36.tar.gz'; \ + ;; \ + ppc64el|powerpc:common64) \ + ESUM='e1cce04600b388777a1a278dda572a664db14cea034dc131155b3da5e6e885e5'; \ + BINARY_URL='https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22%2B36/OpenJDK22U-jre_ppc64le_linux_hotspot_22_36.tar.gz'; \ + ;; \ + *) \ + echo "Unsupported arch: ${ARCH}"; \ + exit 1; \ + ;; \ + esac; \ + wget --progress=dot:giga -O /tmp/openjdk.tar.gz ${BINARY_URL}; \ + echo "${ESUM} */tmp/openjdk.tar.gz" | sha256sum -c -; \ + mkdir -p "$JAVA_HOME"; \ + tar --extract \ + --file /tmp/openjdk.tar.gz \ + --directory "$JAVA_HOME" \ + --strip-components 1 \ + --no-same-owner \ + ; \ + rm -f /tmp/openjdk.tar.gz ${JAVA_HOME}/lib/src.zip; \ + # https://github.com/docker-library/openjdk/issues/331#issuecomment-498834472 + find "$JAVA_HOME/lib" -name '*.so' -exec dirname '{}' ';' | sort -u > /etc/ld.so.conf.d/docker-openjdk.conf; \ + ldconfig; \ + # https://github.com/docker-library/openjdk/issues/212#issuecomment-420979840 + # https://openjdk.java.net/jeps/341 + java -Xshare:dump; + +RUN set -eux; \ + echo "Verifying install ..."; \ + echo "java --version"; java --version; \ + echo "Complete." +COPY entrypoint.sh /__cacert_entrypoint.sh +ENTRYPOINT ["/__cacert_entrypoint.sh"] diff --git a/22/jre/ubuntu/jammy/entrypoint.sh b/22/jre/ubuntu/jammy/entrypoint.sh new file mode 100755 index 000000000..dfcf546f9 --- /dev/null +++ b/22/jre/ubuntu/jammy/entrypoint.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# Sheband needs to be `bash`, see https://github.com/adoptium/containers/issues/415 for details + +set -e + +# Opt-in is only activated if the environment variable is set +if [ -n "$USE_SYSTEM_CA_CERTS" ]; then + + # Copy certificates from /certificates to the system truststore, but only if the directory exists and is not empty. + # The reason why this is not part of the opt-in is because it leaves open the option to mount certificates at the + # system location, for whatever reason. + if [ -d /certificates ] && [ "$(ls -A /certificates)" ]; then + cp -a /certificates/* /usr/local/share/ca-certificates/ + fi + + CACERT=$JAVA_HOME/lib/security/cacerts + + # JDK8 puts its JRE in a subdirectory + if [ -f "$JAVA_HOME/jre/lib/security/cacerts" ]; then + CACERT=$JAVA_HOME/jre/lib/security/cacerts + fi + + # OpenJDK images used to create a hook for `update-ca-certificates`. Since we are using an entrypoint anyway, we + # might as well just generate the truststore and skip the hooks. + update-ca-certificates + + trust extract --overwrite --format=java-cacerts --filter=ca-anchors --purpose=server-auth "$CACERT" +fi + +exec "$@" diff --git a/22/jre/windows/nanoserver-1809/Dockerfile b/22/jre/windows/nanoserver-1809/Dockerfile new file mode 100644 index 000000000..857dcd6a4 --- /dev/null +++ b/22/jre/windows/nanoserver-1809/Dockerfile @@ -0,0 +1,38 @@ +# ------------------------------------------------------------------------------ +# NOTE: THIS DOCKERFILE IS GENERATED VIA "generate_dockerfiles.py" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# ------------------------------------------------------------------------------ +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +FROM mcr.microsoft.com/windows/nanoserver:1809 + +SHELL ["cmd", "/s", "/c"] + +ENV JAVA_VERSION jdk-22+36 + +ENV JAVA_HOME C:\\openjdk-22 +# "ERROR: Access to the registry path is denied." +USER ContainerAdministrator +RUN echo Updating PATH: %JAVA_HOME%\bin;%PATH% \ + && setx /M PATH %JAVA_HOME%\bin;%PATH% \ + && echo Complete. +USER ContainerUser + +COPY --from=eclipse-temurin:22_36-jre-windowsservercore-1809 $JAVA_HOME $JAVA_HOME + +RUN echo Verifying install ... \ + && echo java --version && java --version \ + && echo Complete. diff --git a/22/jre/windows/nanoserver-ltsc2022/Dockerfile b/22/jre/windows/nanoserver-ltsc2022/Dockerfile new file mode 100644 index 000000000..85522ad2b --- /dev/null +++ b/22/jre/windows/nanoserver-ltsc2022/Dockerfile @@ -0,0 +1,38 @@ +# ------------------------------------------------------------------------------ +# NOTE: THIS DOCKERFILE IS GENERATED VIA "generate_dockerfiles.py" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# ------------------------------------------------------------------------------ +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +FROM mcr.microsoft.com/windows/nanoserver:ltsc2022 + +SHELL ["cmd", "/s", "/c"] + +ENV JAVA_VERSION jdk-22+36 + +ENV JAVA_HOME C:\\openjdk-22 +# "ERROR: Access to the registry path is denied." +USER ContainerAdministrator +RUN echo Updating PATH: %JAVA_HOME%\bin;%PATH% \ + && setx /M PATH %JAVA_HOME%\bin;%PATH% \ + && echo Complete. +USER ContainerUser + +COPY --from=eclipse-temurin:22_36-jre-windowsservercore-ltsc2022 $JAVA_HOME $JAVA_HOME + +RUN echo Verifying install ... \ + && echo java --version && java --version \ + && echo Complete. diff --git a/22/jre/windows/windowsservercore-1809/Dockerfile b/22/jre/windows/windowsservercore-1809/Dockerfile new file mode 100644 index 000000000..2301c682c --- /dev/null +++ b/22/jre/windows/windowsservercore-1809/Dockerfile @@ -0,0 +1,53 @@ +# ------------------------------------------------------------------------------ +# NOTE: THIS DOCKERFILE IS GENERATED VIA "generate_dockerfiles.py" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# ------------------------------------------------------------------------------ +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +FROM mcr.microsoft.com/windows/servercore:1809 + +# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV JAVA_VERSION jdk-22+36 + +RUN Write-Host ('Downloading https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22%2B36/OpenJDK22U-jre_x64_windows_hotspot_22_36.msi ...'); \ + curl.exe -LfsSo openjdk.msi https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22%2B36/OpenJDK22U-jre_x64_windows_hotspot_22_36.msi ; \ + Write-Host ('Verifying sha256 (fa6b75f1dbd9eca8bfbd955d2a78d4fc8c678127790caf4340ce2991c7b668c9) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne 'fa6b75f1dbd9eca8bfbd955d2a78d4fc8c678127790caf4340ce2991c7b668c9') { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + New-Item -ItemType Directory -Path C:\temp | Out-Null; \ + \ + Write-Host 'Installing using MSI ...'; \ + $proc = Start-Process -FilePath "msiexec.exe" -ArgumentList '/i', 'openjdk.msi', '/L*V', 'C:\temp\OpenJDK.log', \ + '/quiet', 'ADDLOCAL=FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome', 'INSTALLDIR=C:\openjdk-22' -Wait -Passthru; \ + $proc.WaitForExit() ; \ + if ($proc.ExitCode -ne 0) { \ + Write-Host 'FAILED installing MSI!' ; \ + exit 1; \ + }; \ + \ + Remove-Item -Path C:\temp -Recurse | Out-Null; \ + Write-Host 'Removing openjdk.msi ...'; \ + Remove-Item openjdk.msi -Force + +RUN Write-Host 'Verifying install ...'; \ + Write-Host 'java --version'; java --version; \ + \ + Write-Host 'Complete.' diff --git a/22/jre/windows/windowsservercore-ltsc2022/Dockerfile b/22/jre/windows/windowsservercore-ltsc2022/Dockerfile new file mode 100644 index 000000000..8bd5d351c --- /dev/null +++ b/22/jre/windows/windowsservercore-ltsc2022/Dockerfile @@ -0,0 +1,53 @@ +# ------------------------------------------------------------------------------ +# NOTE: THIS DOCKERFILE IS GENERATED VIA "generate_dockerfiles.py" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# ------------------------------------------------------------------------------ +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +FROM mcr.microsoft.com/windows/servercore:ltsc2022 + +# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ENV JAVA_VERSION jdk-22+36 + +RUN Write-Host ('Downloading https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22%2B36/OpenJDK22U-jre_x64_windows_hotspot_22_36.msi ...'); \ + curl.exe -LfsSo openjdk.msi https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22%2B36/OpenJDK22U-jre_x64_windows_hotspot_22_36.msi ; \ + Write-Host ('Verifying sha256 (fa6b75f1dbd9eca8bfbd955d2a78d4fc8c678127790caf4340ce2991c7b668c9) ...'); \ + if ((Get-FileHash openjdk.msi -Algorithm sha256).Hash -ne 'fa6b75f1dbd9eca8bfbd955d2a78d4fc8c678127790caf4340ce2991c7b668c9') { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + New-Item -ItemType Directory -Path C:\temp | Out-Null; \ + \ + Write-Host 'Installing using MSI ...'; \ + $proc = Start-Process -FilePath "msiexec.exe" -ArgumentList '/i', 'openjdk.msi', '/L*V', 'C:\temp\OpenJDK.log', \ + '/quiet', 'ADDLOCAL=FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome', 'INSTALLDIR=C:\openjdk-22' -Wait -Passthru; \ + $proc.WaitForExit() ; \ + if ($proc.ExitCode -ne 0) { \ + Write-Host 'FAILED installing MSI!' ; \ + exit 1; \ + }; \ + \ + Remove-Item -Path C:\temp -Recurse | Out-Null; \ + Write-Host 'Removing openjdk.msi ...'; \ + Remove-Item openjdk.msi -Force + +RUN Write-Host 'Verifying install ...'; \ + Write-Host 'java --version'; java --version; \ + \ + Write-Host 'Complete.'