diff --git a/24/jdk/bookworm/Dockerfile b/24/jdk/bookworm/Dockerfile new file mode 100644 index 00000000..16420765 --- /dev/null +++ b/24/jdk/bookworm/Dockerfile @@ -0,0 +1,96 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM buildpack-deps:bookworm-scm + +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + bzip2 \ + unzip \ + xz-utils \ + \ +# 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 \ + \ +# java.lang.UnsatisfiedLinkError: /usr/local/openjdk-11/lib/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 libfreetype6 \ + \ +# utilities for keeping Debian and OpenJDK CA certificates in sync + ca-certificates p11-kit \ + ; \ + rm -rf /var/lib/apt/lists/* + +ENV JAVA_HOME /usr/local/openjdk-24 +ENV PATH $JAVA_HOME/bin:$PATH + +# Default to UTF-8 file.encoding +ENV LANG C.UTF-8 + +# https://jdk.java.net/ +# > +# > Java Development Kit builds, from Oracle +# > +ENV JAVA_VERSION 24-ea+1 + +RUN set -eux; \ + \ + arch="$(dpkg --print-architecture)"; \ + case "$arch" in \ + 'amd64') \ + downloadUrl='https://download.java.net/java/early_access/jdk24/1/GPL/openjdk-24-ea+1_linux-x64_bin.tar.gz'; \ + downloadSha256='8548b9f8147e53846600a5afd39adb7f3f50a226edeb12e336d43837708f0dfe'; \ + ;; \ + 'arm64') \ + downloadUrl='https://download.java.net/java/early_access/jdk24/1/GPL/openjdk-24-ea+1_linux-aarch64_bin.tar.gz'; \ + downloadSha256='d98e475916eb68814f1ddacc0ba56128025a829351b7bc51e4b4b862cf12d5fb'; \ + ;; \ + *) echo >&2 "error: unsupported architecture: '$arch'"; exit 1 ;; \ + esac; \ + \ + wget --progress=dot:giga -O openjdk.tgz "$downloadUrl"; \ + echo "$downloadSha256 *openjdk.tgz" | sha256sum --strict --check -; \ + \ + mkdir -p "$JAVA_HOME"; \ + tar --extract \ + --file openjdk.tgz \ + --directory "$JAVA_HOME" \ + --strip-components 1 \ + --no-same-owner \ + ; \ + rm openjdk.tgz*; \ + \ +# update "cacerts" bundle to use Debian's CA certificates (and make sure it stays up-to-date with changes to Debian's store) +# see https://github.com/docker-library/openjdk/issues/327 +# http://rabexc.org/posts/certificates-not-working-java#comment-4099504075 +# https://salsa.debian.org/java-team/ca-certificates-java/blob/3e51a84e9104823319abeb31f880580e46f45a98/debian/jks-keystore.hook.in +# https://git.alpinelinux.org/aports/tree/community/java-cacerts/APKBUILD?id=761af65f38b4570093461e6546dcf6b179d2b624#n29 + { \ + echo '#!/usr/bin/env bash'; \ + echo 'set -Eeuo pipefail'; \ + echo 'trust extract --overwrite --format=java-cacerts --filter=ca-anchors --purpose=server-auth "$JAVA_HOME/lib/security/cacerts"'; \ + } > /etc/ca-certificates/update.d/docker-openjdk; \ + chmod +x /etc/ca-certificates/update.d/docker-openjdk; \ + /etc/ca-certificates/update.d/docker-openjdk; \ + \ +# 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; \ + \ +# basic smoke test + fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ + javac --version; \ + java --version + +# "jshell" is an interactive REPL for Java (see https://en.wikipedia.org/wiki/JShell) +CMD ["jshell"] diff --git a/24/jdk/bullseye/Dockerfile b/24/jdk/bullseye/Dockerfile new file mode 100644 index 00000000..7ee7025a --- /dev/null +++ b/24/jdk/bullseye/Dockerfile @@ -0,0 +1,96 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM buildpack-deps:bullseye-scm + +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + bzip2 \ + unzip \ + xz-utils \ + \ +# 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 \ + \ +# java.lang.UnsatisfiedLinkError: /usr/local/openjdk-11/lib/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 libfreetype6 \ + \ +# utilities for keeping Debian and OpenJDK CA certificates in sync + ca-certificates p11-kit \ + ; \ + rm -rf /var/lib/apt/lists/* + +ENV JAVA_HOME /usr/local/openjdk-24 +ENV PATH $JAVA_HOME/bin:$PATH + +# Default to UTF-8 file.encoding +ENV LANG C.UTF-8 + +# https://jdk.java.net/ +# > +# > Java Development Kit builds, from Oracle +# > +ENV JAVA_VERSION 24-ea+1 + +RUN set -eux; \ + \ + arch="$(dpkg --print-architecture)"; \ + case "$arch" in \ + 'amd64') \ + downloadUrl='https://download.java.net/java/early_access/jdk24/1/GPL/openjdk-24-ea+1_linux-x64_bin.tar.gz'; \ + downloadSha256='8548b9f8147e53846600a5afd39adb7f3f50a226edeb12e336d43837708f0dfe'; \ + ;; \ + 'arm64') \ + downloadUrl='https://download.java.net/java/early_access/jdk24/1/GPL/openjdk-24-ea+1_linux-aarch64_bin.tar.gz'; \ + downloadSha256='d98e475916eb68814f1ddacc0ba56128025a829351b7bc51e4b4b862cf12d5fb'; \ + ;; \ + *) echo >&2 "error: unsupported architecture: '$arch'"; exit 1 ;; \ + esac; \ + \ + wget --progress=dot:giga -O openjdk.tgz "$downloadUrl"; \ + echo "$downloadSha256 *openjdk.tgz" | sha256sum --strict --check -; \ + \ + mkdir -p "$JAVA_HOME"; \ + tar --extract \ + --file openjdk.tgz \ + --directory "$JAVA_HOME" \ + --strip-components 1 \ + --no-same-owner \ + ; \ + rm openjdk.tgz*; \ + \ +# update "cacerts" bundle to use Debian's CA certificates (and make sure it stays up-to-date with changes to Debian's store) +# see https://github.com/docker-library/openjdk/issues/327 +# http://rabexc.org/posts/certificates-not-working-java#comment-4099504075 +# https://salsa.debian.org/java-team/ca-certificates-java/blob/3e51a84e9104823319abeb31f880580e46f45a98/debian/jks-keystore.hook.in +# https://git.alpinelinux.org/aports/tree/community/java-cacerts/APKBUILD?id=761af65f38b4570093461e6546dcf6b179d2b624#n29 + { \ + echo '#!/usr/bin/env bash'; \ + echo 'set -Eeuo pipefail'; \ + echo 'trust extract --overwrite --format=java-cacerts --filter=ca-anchors --purpose=server-auth "$JAVA_HOME/lib/security/cacerts"'; \ + } > /etc/ca-certificates/update.d/docker-openjdk; \ + chmod +x /etc/ca-certificates/update.d/docker-openjdk; \ + /etc/ca-certificates/update.d/docker-openjdk; \ + \ +# 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; \ + \ +# basic smoke test + fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ + javac --version; \ + java --version + +# "jshell" is an interactive REPL for Java (see https://en.wikipedia.org/wiki/JShell) +CMD ["jshell"] diff --git a/24/jdk/oraclelinux8/Dockerfile b/24/jdk/oraclelinux8/Dockerfile new file mode 100644 index 00000000..8c455b32 --- /dev/null +++ b/24/jdk/oraclelinux8/Dockerfile @@ -0,0 +1,85 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM oraclelinux:8-slim + +RUN set -eux; \ + microdnf install \ + gzip \ + tar \ + \ +# 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 \ +# java.lang.UnsatisfiedLinkError: /usr/java/openjdk-12/lib/libfontmanager.so: libfreetype.so.6: cannot open shared object file: No such file or directory +# https://github.com/docker-library/openjdk/pull/235#issuecomment-424466077 + freetype fontconfig \ + ; \ + microdnf clean all + +ENV JAVA_HOME /usr/java/openjdk-24 +ENV PATH $JAVA_HOME/bin:$PATH + +# Default to UTF-8 file.encoding +ENV LANG C.UTF-8 + +# https://jdk.java.net/ +# > +# > Java Development Kit builds, from Oracle +# > +ENV JAVA_VERSION 24-ea+1 + +RUN set -eux; \ + \ + arch="$(rpm --query --queryformat='%{ARCH}' rpm)"; \ + case "$arch" in \ + 'x86_64') \ + downloadUrl='https://download.java.net/java/early_access/jdk24/1/GPL/openjdk-24-ea+1_linux-x64_bin.tar.gz'; \ + downloadSha256='8548b9f8147e53846600a5afd39adb7f3f50a226edeb12e336d43837708f0dfe'; \ + ;; \ + 'aarch64') \ + downloadUrl='https://download.java.net/java/early_access/jdk24/1/GPL/openjdk-24-ea+1_linux-aarch64_bin.tar.gz'; \ + downloadSha256='d98e475916eb68814f1ddacc0ba56128025a829351b7bc51e4b4b862cf12d5fb'; \ + ;; \ + *) echo >&2 "error: unsupported architecture: '$arch'"; exit 1 ;; \ + esac; \ + \ + curl -fL -o openjdk.tgz "$downloadUrl"; \ + echo "$downloadSha256 *openjdk.tgz" | sha256sum --strict --check -; \ + \ + mkdir -p "$JAVA_HOME"; \ + tar --extract \ + --file openjdk.tgz \ + --directory "$JAVA_HOME" \ + --strip-components 1 \ + --no-same-owner \ + ; \ + rm openjdk.tgz*; \ + \ + rm -rf "$JAVA_HOME/lib/security/cacerts"; \ +# see "update-ca-trust" script which creates/maintains this cacerts bundle + ln -sT /etc/pki/ca-trust/extracted/java/cacerts "$JAVA_HOME/lib/security/cacerts"; \ + \ +# https://github.com/oracle/docker-images/blob/a56e0d1ed968ff669d2e2ba8a1483d0f3acc80c0/OracleJava/java-8/Dockerfile#L17-L19 + ln -sfT "$JAVA_HOME" /usr/java/default; \ + ln -sfT "$JAVA_HOME" /usr/java/latest; \ + for bin in "$JAVA_HOME/bin/"*; do \ + base="$(basename "$bin")"; \ + [ ! -e "/usr/bin/$base" ]; \ + alternatives --install "/usr/bin/$base" "$base" "$bin" 20000; \ + done; \ + \ +# https://github.com/docker-library/openjdk/issues/212#issuecomment-420979840 +# https://openjdk.java.net/jeps/341 + java -Xshare:dump; \ + \ +# basic smoke test + fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ + javac --version; \ + java --version + +# "jshell" is an interactive REPL for Java (see https://en.wikipedia.org/wiki/JShell) +CMD ["jshell"] diff --git a/24/jdk/oraclelinux9/Dockerfile b/24/jdk/oraclelinux9/Dockerfile new file mode 100644 index 00000000..f9deffd1 --- /dev/null +++ b/24/jdk/oraclelinux9/Dockerfile @@ -0,0 +1,85 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM oraclelinux:9-slim + +RUN set -eux; \ + microdnf install \ + gzip \ + tar \ + \ +# 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 \ +# java.lang.UnsatisfiedLinkError: /usr/java/openjdk-12/lib/libfontmanager.so: libfreetype.so.6: cannot open shared object file: No such file or directory +# https://github.com/docker-library/openjdk/pull/235#issuecomment-424466077 + freetype fontconfig \ + ; \ + microdnf clean all + +ENV JAVA_HOME /usr/java/openjdk-24 +ENV PATH $JAVA_HOME/bin:$PATH + +# Default to UTF-8 file.encoding +ENV LANG C.UTF-8 + +# https://jdk.java.net/ +# > +# > Java Development Kit builds, from Oracle +# > +ENV JAVA_VERSION 24-ea+1 + +RUN set -eux; \ + \ + arch="$(rpm --query --queryformat='%{ARCH}' rpm)"; \ + case "$arch" in \ + 'x86_64') \ + downloadUrl='https://download.java.net/java/early_access/jdk24/1/GPL/openjdk-24-ea+1_linux-x64_bin.tar.gz'; \ + downloadSha256='8548b9f8147e53846600a5afd39adb7f3f50a226edeb12e336d43837708f0dfe'; \ + ;; \ + 'aarch64') \ + downloadUrl='https://download.java.net/java/early_access/jdk24/1/GPL/openjdk-24-ea+1_linux-aarch64_bin.tar.gz'; \ + downloadSha256='d98e475916eb68814f1ddacc0ba56128025a829351b7bc51e4b4b862cf12d5fb'; \ + ;; \ + *) echo >&2 "error: unsupported architecture: '$arch'"; exit 1 ;; \ + esac; \ + \ + curl -fL -o openjdk.tgz "$downloadUrl"; \ + echo "$downloadSha256 *openjdk.tgz" | sha256sum --strict --check -; \ + \ + mkdir -p "$JAVA_HOME"; \ + tar --extract \ + --file openjdk.tgz \ + --directory "$JAVA_HOME" \ + --strip-components 1 \ + --no-same-owner \ + ; \ + rm openjdk.tgz*; \ + \ + rm -rf "$JAVA_HOME/lib/security/cacerts"; \ +# see "update-ca-trust" script which creates/maintains this cacerts bundle + ln -sT /etc/pki/ca-trust/extracted/java/cacerts "$JAVA_HOME/lib/security/cacerts"; \ + \ +# https://github.com/oracle/docker-images/blob/a56e0d1ed968ff669d2e2ba8a1483d0f3acc80c0/OracleJava/java-8/Dockerfile#L17-L19 + ln -sfT "$JAVA_HOME" /usr/java/default; \ + ln -sfT "$JAVA_HOME" /usr/java/latest; \ + for bin in "$JAVA_HOME/bin/"*; do \ + base="$(basename "$bin")"; \ + [ ! -e "/usr/bin/$base" ]; \ + alternatives --install "/usr/bin/$base" "$base" "$bin" 20000; \ + done; \ + \ +# https://github.com/docker-library/openjdk/issues/212#issuecomment-420979840 +# https://openjdk.java.net/jeps/341 + java -Xshare:dump; \ + \ +# basic smoke test + fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ + javac --version; \ + java --version + +# "jshell" is an interactive REPL for Java (see https://en.wikipedia.org/wiki/JShell) +CMD ["jshell"] diff --git a/24/jdk/slim-bookworm/Dockerfile b/24/jdk/slim-bookworm/Dockerfile new file mode 100644 index 00000000..35b76f24 --- /dev/null +++ b/24/jdk/slim-bookworm/Dockerfile @@ -0,0 +1,94 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:bookworm-slim + +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ +# utilities for keeping Debian and OpenJDK CA certificates in sync + ca-certificates p11-kit \ + ; \ + rm -rf /var/lib/apt/lists/* + +ENV JAVA_HOME /usr/local/openjdk-24 +ENV PATH $JAVA_HOME/bin:$PATH + +# Default to UTF-8 file.encoding +ENV LANG C.UTF-8 + +# https://jdk.java.net/ +# > +# > Java Development Kit builds, from Oracle +# > +ENV JAVA_VERSION 24-ea+1 + +RUN set -eux; \ + \ + arch="$(dpkg --print-architecture)"; \ + case "$arch" in \ + 'amd64') \ + downloadUrl='https://download.java.net/java/early_access/jdk24/1/GPL/openjdk-24-ea+1_linux-x64_bin.tar.gz'; \ + downloadSha256='8548b9f8147e53846600a5afd39adb7f3f50a226edeb12e336d43837708f0dfe'; \ + ;; \ + 'arm64') \ + downloadUrl='https://download.java.net/java/early_access/jdk24/1/GPL/openjdk-24-ea+1_linux-aarch64_bin.tar.gz'; \ + downloadSha256='d98e475916eb68814f1ddacc0ba56128025a829351b7bc51e4b4b862cf12d5fb'; \ + ;; \ + *) echo >&2 "error: unsupported architecture: '$arch'"; exit 1 ;; \ + esac; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + wget --progress=dot:giga -O openjdk.tgz "$downloadUrl"; \ + echo "$downloadSha256 *openjdk.tgz" | sha256sum --strict --check -; \ + \ + mkdir -p "$JAVA_HOME"; \ + tar --extract \ + --file openjdk.tgz \ + --directory "$JAVA_HOME" \ + --strip-components 1 \ + --no-same-owner \ + ; \ + rm openjdk.tgz*; \ + \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + \ +# update "cacerts" bundle to use Debian's CA certificates (and make sure it stays up-to-date with changes to Debian's store) +# see https://github.com/docker-library/openjdk/issues/327 +# http://rabexc.org/posts/certificates-not-working-java#comment-4099504075 +# https://salsa.debian.org/java-team/ca-certificates-java/blob/3e51a84e9104823319abeb31f880580e46f45a98/debian/jks-keystore.hook.in +# https://git.alpinelinux.org/aports/tree/community/java-cacerts/APKBUILD?id=761af65f38b4570093461e6546dcf6b179d2b624#n29 + { \ + echo '#!/usr/bin/env bash'; \ + echo 'set -Eeuo pipefail'; \ + echo 'trust extract --overwrite --format=java-cacerts --filter=ca-anchors --purpose=server-auth "$JAVA_HOME/lib/security/cacerts"'; \ + } > /etc/ca-certificates/update.d/docker-openjdk; \ + chmod +x /etc/ca-certificates/update.d/docker-openjdk; \ + /etc/ca-certificates/update.d/docker-openjdk; \ + \ +# 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; \ + \ +# basic smoke test + fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ + javac --version; \ + java --version + +# "jshell" is an interactive REPL for Java (see https://en.wikipedia.org/wiki/JShell) +CMD ["jshell"] diff --git a/24/jdk/slim-bullseye/Dockerfile b/24/jdk/slim-bullseye/Dockerfile new file mode 100644 index 00000000..86334782 --- /dev/null +++ b/24/jdk/slim-bullseye/Dockerfile @@ -0,0 +1,94 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM debian:bullseye-slim + +RUN set -eux; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ +# utilities for keeping Debian and OpenJDK CA certificates in sync + ca-certificates p11-kit \ + ; \ + rm -rf /var/lib/apt/lists/* + +ENV JAVA_HOME /usr/local/openjdk-24 +ENV PATH $JAVA_HOME/bin:$PATH + +# Default to UTF-8 file.encoding +ENV LANG C.UTF-8 + +# https://jdk.java.net/ +# > +# > Java Development Kit builds, from Oracle +# > +ENV JAVA_VERSION 24-ea+1 + +RUN set -eux; \ + \ + arch="$(dpkg --print-architecture)"; \ + case "$arch" in \ + 'amd64') \ + downloadUrl='https://download.java.net/java/early_access/jdk24/1/GPL/openjdk-24-ea+1_linux-x64_bin.tar.gz'; \ + downloadSha256='8548b9f8147e53846600a5afd39adb7f3f50a226edeb12e336d43837708f0dfe'; \ + ;; \ + 'arm64') \ + downloadUrl='https://download.java.net/java/early_access/jdk24/1/GPL/openjdk-24-ea+1_linux-aarch64_bin.tar.gz'; \ + downloadSha256='d98e475916eb68814f1ddacc0ba56128025a829351b7bc51e4b4b862cf12d5fb'; \ + ;; \ + *) echo >&2 "error: unsupported architecture: '$arch'"; exit 1 ;; \ + esac; \ + \ + savedAptMark="$(apt-mark showmanual)"; \ + apt-get update; \ + apt-get install -y --no-install-recommends \ + wget \ + ; \ + rm -rf /var/lib/apt/lists/*; \ + \ + wget --progress=dot:giga -O openjdk.tgz "$downloadUrl"; \ + echo "$downloadSha256 *openjdk.tgz" | sha256sum --strict --check -; \ + \ + mkdir -p "$JAVA_HOME"; \ + tar --extract \ + --file openjdk.tgz \ + --directory "$JAVA_HOME" \ + --strip-components 1 \ + --no-same-owner \ + ; \ + rm openjdk.tgz*; \ + \ + apt-mark auto '.*' > /dev/null; \ + [ -z "$savedAptMark" ] || apt-mark manual $savedAptMark > /dev/null; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ + \ +# update "cacerts" bundle to use Debian's CA certificates (and make sure it stays up-to-date with changes to Debian's store) +# see https://github.com/docker-library/openjdk/issues/327 +# http://rabexc.org/posts/certificates-not-working-java#comment-4099504075 +# https://salsa.debian.org/java-team/ca-certificates-java/blob/3e51a84e9104823319abeb31f880580e46f45a98/debian/jks-keystore.hook.in +# https://git.alpinelinux.org/aports/tree/community/java-cacerts/APKBUILD?id=761af65f38b4570093461e6546dcf6b179d2b624#n29 + { \ + echo '#!/usr/bin/env bash'; \ + echo 'set -Eeuo pipefail'; \ + echo 'trust extract --overwrite --format=java-cacerts --filter=ca-anchors --purpose=server-auth "$JAVA_HOME/lib/security/cacerts"'; \ + } > /etc/ca-certificates/update.d/docker-openjdk; \ + chmod +x /etc/ca-certificates/update.d/docker-openjdk; \ + /etc/ca-certificates/update.d/docker-openjdk; \ + \ +# 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; \ + \ +# basic smoke test + fileEncoding="$(echo 'System.out.println(System.getProperty("file.encoding"))' | jshell -s -)"; [ "$fileEncoding" = 'UTF-8' ]; rm -rf ~/.java; \ + javac --version; \ + java --version + +# "jshell" is an interactive REPL for Java (see https://en.wikipedia.org/wiki/JShell) +CMD ["jshell"] diff --git a/24/jdk/windows/nanoserver-1809/Dockerfile b/24/jdk/windows/nanoserver-1809/Dockerfile new file mode 100644 index 00000000..71ef11b6 --- /dev/null +++ b/24/jdk/windows/nanoserver-1809/Dockerfile @@ -0,0 +1,33 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM mcr.microsoft.com/windows/nanoserver:1809 + +SHELL ["cmd", "/s", "/c"] + +ENV JAVA_HOME C:\\openjdk-24 +# "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 + +# https://jdk.java.net/ +# > +# > Java Development Kit builds, from Oracle +# > +ENV JAVA_VERSION 24-ea+1 + +COPY --from=openjdk:24-ea-1-jdk-windowsservercore-1809 $JAVA_HOME $JAVA_HOME + +RUN echo Verifying install ... \ + && echo javac --version && javac --version \ + && echo java --version && java --version \ + && echo Complete. + +# "jshell" is an interactive REPL for Java (see https://en.wikipedia.org/wiki/JShell) +CMD ["jshell"] diff --git a/24/jdk/windows/windowsservercore-1809/Dockerfile b/24/jdk/windows/windowsservercore-1809/Dockerfile new file mode 100644 index 00000000..eafdab83 --- /dev/null +++ b/24/jdk/windows/windowsservercore-1809/Dockerfile @@ -0,0 +1,65 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM mcr.microsoft.com/windows/servercore:1809 + +# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +# enable TLS 1.2 +# https://docs.microsoft.com/en-us/system-center/vmm/install-tls?view=sc-vmm-1801 +# https://docs.microsoft.com/en-us/windows-server/identity/ad-fs/operations/manage-ssl-protocols-in-ad-fs#enable-tls-12 +RUN Write-Host 'Enabling TLS 1.2 (https://githubengineering.com/crypto-removal-notice/) ...'; \ + $tls12RegBase = 'HKLM:\\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2'; \ + if (Test-Path $tls12RegBase) { throw ('"{0}" already exists!' -f $tls12RegBase) }; \ + New-Item -Path ('{0}/Client' -f $tls12RegBase) -Force; \ + New-Item -Path ('{0}/Server' -f $tls12RegBase) -Force; \ + New-ItemProperty -Path ('{0}/Client' -f $tls12RegBase) -Name 'DisabledByDefault' -PropertyType DWORD -Value 0 -Force; \ + New-ItemProperty -Path ('{0}/Client' -f $tls12RegBase) -Name 'Enabled' -PropertyType DWORD -Value 1 -Force; \ + New-ItemProperty -Path ('{0}/Server' -f $tls12RegBase) -Name 'DisabledByDefault' -PropertyType DWORD -Value 0 -Force; \ + New-ItemProperty -Path ('{0}/Server' -f $tls12RegBase) -Name 'Enabled' -PropertyType DWORD -Value 1 -Force; \ + Write-Host 'Complete.' + +ENV JAVA_HOME C:\\openjdk-24 +RUN $newPath = ('{0}\bin;{1}' -f $env:JAVA_HOME, $env:PATH); \ + Write-Host ('Updating PATH: {0}' -f $newPath); \ + setx /M PATH $newPath; \ + Write-Host 'Complete.' + +# https://jdk.java.net/ +# > +# > Java Development Kit builds, from Oracle +# > +ENV JAVA_VERSION 24-ea+1 +ENV JAVA_URL https://download.java.net/java/early_access/jdk24/1/GPL/openjdk-24-ea+1_windows-x64_bin.zip +ENV JAVA_SHA256 84640da466dc6c7af5dbd523e321f5cfef6b81a434c1558b43633e7485da95f7 + +RUN Write-Host ('Downloading {0} ...' -f $env:JAVA_URL); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri $env:JAVA_URL -OutFile 'openjdk.zip'; \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:JAVA_SHA256); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne $env:JAVA_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host 'Expanding ...'; \ + New-Item -ItemType Directory -Path C:\temp | Out-Null; \ + Expand-Archive openjdk.zip -DestinationPath C:\temp; \ + Move-Item -Path C:\temp\* -Destination $env:JAVA_HOME; \ + Remove-Item C:\temp; \ + \ + Write-Host 'Removing ...'; \ + Remove-Item openjdk.zip -Force; \ + \ + Write-Host 'Verifying install ...'; \ + Write-Host ' javac --version'; javac --version; \ + Write-Host ' java --version'; java --version; \ + \ + Write-Host 'Complete.' + +# "jshell" is an interactive REPL for Java (see https://en.wikipedia.org/wiki/JShell) +CMD ["jshell"] diff --git a/24/jdk/windows/windowsservercore-ltsc2022/Dockerfile b/24/jdk/windows/windowsservercore-ltsc2022/Dockerfile new file mode 100644 index 00000000..74bd2d51 --- /dev/null +++ b/24/jdk/windows/windowsservercore-ltsc2022/Dockerfile @@ -0,0 +1,65 @@ +# +# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# + +FROM mcr.microsoft.com/windows/servercore:ltsc2022 + +# $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324 +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +# enable TLS 1.2 +# https://docs.microsoft.com/en-us/system-center/vmm/install-tls?view=sc-vmm-1801 +# https://docs.microsoft.com/en-us/windows-server/identity/ad-fs/operations/manage-ssl-protocols-in-ad-fs#enable-tls-12 +RUN Write-Host 'Enabling TLS 1.2 (https://githubengineering.com/crypto-removal-notice/) ...'; \ + $tls12RegBase = 'HKLM:\\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2'; \ + if (Test-Path $tls12RegBase) { throw ('"{0}" already exists!' -f $tls12RegBase) }; \ + New-Item -Path ('{0}/Client' -f $tls12RegBase) -Force; \ + New-Item -Path ('{0}/Server' -f $tls12RegBase) -Force; \ + New-ItemProperty -Path ('{0}/Client' -f $tls12RegBase) -Name 'DisabledByDefault' -PropertyType DWORD -Value 0 -Force; \ + New-ItemProperty -Path ('{0}/Client' -f $tls12RegBase) -Name 'Enabled' -PropertyType DWORD -Value 1 -Force; \ + New-ItemProperty -Path ('{0}/Server' -f $tls12RegBase) -Name 'DisabledByDefault' -PropertyType DWORD -Value 0 -Force; \ + New-ItemProperty -Path ('{0}/Server' -f $tls12RegBase) -Name 'Enabled' -PropertyType DWORD -Value 1 -Force; \ + Write-Host 'Complete.' + +ENV JAVA_HOME C:\\openjdk-24 +RUN $newPath = ('{0}\bin;{1}' -f $env:JAVA_HOME, $env:PATH); \ + Write-Host ('Updating PATH: {0}' -f $newPath); \ + setx /M PATH $newPath; \ + Write-Host 'Complete.' + +# https://jdk.java.net/ +# > +# > Java Development Kit builds, from Oracle +# > +ENV JAVA_VERSION 24-ea+1 +ENV JAVA_URL https://download.java.net/java/early_access/jdk24/1/GPL/openjdk-24-ea+1_windows-x64_bin.zip +ENV JAVA_SHA256 84640da466dc6c7af5dbd523e321f5cfef6b81a434c1558b43633e7485da95f7 + +RUN Write-Host ('Downloading {0} ...' -f $env:JAVA_URL); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -Uri $env:JAVA_URL -OutFile 'openjdk.zip'; \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:JAVA_SHA256); \ + if ((Get-FileHash openjdk.zip -Algorithm sha256).Hash -ne $env:JAVA_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ + Write-Host 'Expanding ...'; \ + New-Item -ItemType Directory -Path C:\temp | Out-Null; \ + Expand-Archive openjdk.zip -DestinationPath C:\temp; \ + Move-Item -Path C:\temp\* -Destination $env:JAVA_HOME; \ + Remove-Item C:\temp; \ + \ + Write-Host 'Removing ...'; \ + Remove-Item openjdk.zip -Force; \ + \ + Write-Host 'Verifying install ...'; \ + Write-Host ' javac --version'; javac --version; \ + Write-Host ' java --version'; java --version; \ + \ + Write-Host 'Complete.' + +# "jshell" is an interactive REPL for Java (see https://en.wikipedia.org/wiki/JShell) +CMD ["jshell"] diff --git a/versions.json b/versions.json index ba2aa58b..47f45a73 100644 --- a/versions.json +++ b/versions.json @@ -28,5 +28,35 @@ "windows/nanoserver-1809" ], "version": "23-ea+26" + }, + "24": { + "jdk": { + "arches": { + "amd64": { + "sha256": "8548b9f8147e53846600a5afd39adb7f3f50a226edeb12e336d43837708f0dfe", + "url": "https://download.java.net/java/early_access/jdk24/1/GPL/openjdk-24-ea+1_linux-x64_bin.tar.gz" + }, + "arm64v8": { + "sha256": "d98e475916eb68814f1ddacc0ba56128025a829351b7bc51e4b4b862cf12d5fb", + "url": "https://download.java.net/java/early_access/jdk24/1/GPL/openjdk-24-ea+1_linux-aarch64_bin.tar.gz" + }, + "windows-amd64": { + "sha256": "84640da466dc6c7af5dbd523e321f5cfef6b81a434c1558b43633e7485da95f7", + "url": "https://download.java.net/java/early_access/jdk24/1/GPL/openjdk-24-ea+1_windows-x64_bin.zip" + } + } + }, + "variants": [ + "oraclelinux9", + "oraclelinux8", + "bookworm", + "slim-bookworm", + "bullseye", + "slim-bullseye", + "windows/windowsservercore-ltsc2022", + "windows/windowsservercore-1809", + "windows/nanoserver-1809" + ], + "version": "24-ea+1" } }