-
Notifications
You must be signed in to change notification settings - Fork 477
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Debian variants of Oracle-consuming versions
These are images based on the official JDK artifacts for 12+ released on https://jdk.java.net/ with a Debian base in addition to Oracle.
- Loading branch information
Showing
8 changed files
with
501 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
FROM buildpack-deps:buster-scm | ||
|
||
RUN set -eux; \ | ||
apt-get update; \ | ||
apt-get install -y --no-install-recommends \ | ||
bzip2 \ | ||
unzip \ | ||
xz-utils \ | ||
\ | ||
# utilities for keeping Debian and OpenJDK CA certificates in sync | ||
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 \ | ||
# 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 \ | ||
; \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Default to UTF-8 file.encoding | ||
ENV LANG C.UTF-8 | ||
|
||
ENV JAVA_HOME /usr/java/openjdk-13 | ||
ENV PATH $JAVA_HOME/bin:$PATH | ||
|
||
# backwards compatibility shim | ||
RUN { echo '#/bin/sh'; echo 'echo "$JAVA_HOME"'; } > /usr/local/bin/docker-java-home && chmod +x /usr/local/bin/docker-java-home && [ "$JAVA_HOME" = "$(docker-java-home)" ] | ||
|
||
# https://jdk.java.net/ | ||
ENV JAVA_VERSION 13 | ||
ENV JAVA_URL https://download.java.net/java/GA/jdk13/5b8a42f3905b406298b72d750b6919f6/33/GPL/openjdk-13_linux-x64_bin.tar.gz | ||
ENV JAVA_SHA256 5f547b8f0ffa7da517223f6f929a5055d749776b1878ccedbd6cc1334f4d6f4d | ||
|
||
RUN set -eux; \ | ||
\ | ||
wget -O openjdk.tgz "$JAVA_URL"; \ | ||
echo "$JAVA_SHA256 */openjdk.tgz" | sha256sum -c -; \ | ||
\ | ||
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 'if ! [ -d "$JAVA_HOME" ]; then echo >&2 "error: missing JAVA_HOME environment variable"; exit 1; fi'; \ | ||
# 8-jdk uses "$JAVA_HOME/jre/lib/security/cacerts" and 8-jre and 11+ uses "$JAVA_HOME/lib/security/cacerts" directly (no "jre" directory) | ||
echo 'cacertsFile=; for f in "$JAVA_HOME/lib/security/cacerts" "$JAVA_HOME/jre/lib/security/cacerts"; do if [ -e "$f" ]; then cacertsFile="$f"; break; fi; done'; \ | ||
echo 'if [ -z "$cacertsFile" ] || ! [ -f "$cacertsFile" ]; then echo >&2 "error: failed to find cacerts file in $JAVA_HOME"; exit 1; fi'; \ | ||
echo 'trust extract --overwrite --format=java-cacerts --filter=ca-anchors --purpose=server-auth "$cacertsFile"'; \ | ||
} > /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 | ||
javac --version; \ | ||
java --version | ||
|
||
# "jshell" is an interactive REPL for Java (see https://en.wikipedia.org/wiki/JShell) | ||
CMD ["jshell"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
FROM debian:buster-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/* | ||
|
||
# Default to UTF-8 file.encoding | ||
ENV LANG C.UTF-8 | ||
|
||
ENV JAVA_HOME /usr/java/openjdk-13 | ||
ENV PATH $JAVA_HOME/bin:$PATH | ||
|
||
# backwards compatibility shim | ||
RUN { echo '#/bin/sh'; echo 'echo "$JAVA_HOME"'; } > /usr/local/bin/docker-java-home && chmod +x /usr/local/bin/docker-java-home && [ "$JAVA_HOME" = "$(docker-java-home)" ] | ||
|
||
# https://jdk.java.net/ | ||
ENV JAVA_VERSION 13 | ||
ENV JAVA_URL https://download.java.net/java/GA/jdk13/5b8a42f3905b406298b72d750b6919f6/33/GPL/openjdk-13_linux-x64_bin.tar.gz | ||
ENV JAVA_SHA256 5f547b8f0ffa7da517223f6f929a5055d749776b1878ccedbd6cc1334f4d6f4d | ||
|
||
RUN set -eux; \ | ||
\ | ||
savedAptMark="$(apt-mark showmanual)"; \ | ||
apt-get update; \ | ||
apt-get install -y --no-install-recommends \ | ||
wget \ | ||
; \ | ||
rm -rf /var/lib/apt/lists/*; \ | ||
\ | ||
wget -O openjdk.tgz "$JAVA_URL"; \ | ||
echo "$JAVA_SHA256 */openjdk.tgz" | sha256sum -c -; \ | ||
\ | ||
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 'if ! [ -d "$JAVA_HOME" ]; then echo >&2 "error: missing JAVA_HOME environment variable"; exit 1; fi'; \ | ||
# 8-jdk uses "$JAVA_HOME/jre/lib/security/cacerts" and 8-jre and 11+ uses "$JAVA_HOME/lib/security/cacerts" directly (no "jre" directory) | ||
echo 'cacertsFile=; for f in "$JAVA_HOME/lib/security/cacerts" "$JAVA_HOME/jre/lib/security/cacerts"; do if [ -e "$f" ]; then cacertsFile="$f"; break; fi; done'; \ | ||
echo 'if [ -z "$cacertsFile" ] || ! [ -f "$cacertsFile" ]; then echo >&2 "error: failed to find cacerts file in $JAVA_HOME"; exit 1; fi'; \ | ||
echo 'trust extract --overwrite --format=java-cacerts --filter=ca-anchors --purpose=server-auth "$cacertsFile"'; \ | ||
} > /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 | ||
javac --version; \ | ||
java --version | ||
|
||
# "jshell" is an interactive REPL for Java (see https://en.wikipedia.org/wiki/JShell) | ||
CMD ["jshell"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
FROM buildpack-deps:buster-scm | ||
|
||
RUN set -eux; \ | ||
apt-get update; \ | ||
apt-get install -y --no-install-recommends \ | ||
bzip2 \ | ||
unzip \ | ||
xz-utils \ | ||
\ | ||
# utilities for keeping Debian and OpenJDK CA certificates in sync | ||
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 \ | ||
# 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 \ | ||
; \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Default to UTF-8 file.encoding | ||
ENV LANG C.UTF-8 | ||
|
||
ENV JAVA_HOME /usr/java/openjdk-14 | ||
ENV PATH $JAVA_HOME/bin:$PATH | ||
|
||
# backwards compatibility shim | ||
RUN { echo '#/bin/sh'; echo 'echo "$JAVA_HOME"'; } > /usr/local/bin/docker-java-home && chmod +x /usr/local/bin/docker-java-home && [ "$JAVA_HOME" = "$(docker-java-home)" ] | ||
|
||
# https://jdk.java.net/ | ||
ENV JAVA_VERSION 14-ea+14 | ||
ENV JAVA_URL https://download.java.net/java/early_access/jdk14/14/GPL/openjdk-14-ea+14_linux-x64_bin.tar.gz | ||
ENV JAVA_SHA256 fc1aed4e0de423dbb27db449b63b25c61b06b80e275f7ef665cce6c61e736726 | ||
|
||
RUN set -eux; \ | ||
\ | ||
wget -O openjdk.tgz "$JAVA_URL"; \ | ||
echo "$JAVA_SHA256 */openjdk.tgz" | sha256sum -c -; \ | ||
\ | ||
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 'if ! [ -d "$JAVA_HOME" ]; then echo >&2 "error: missing JAVA_HOME environment variable"; exit 1; fi'; \ | ||
# 8-jdk uses "$JAVA_HOME/jre/lib/security/cacerts" and 8-jre and 11+ uses "$JAVA_HOME/lib/security/cacerts" directly (no "jre" directory) | ||
echo 'cacertsFile=; for f in "$JAVA_HOME/lib/security/cacerts" "$JAVA_HOME/jre/lib/security/cacerts"; do if [ -e "$f" ]; then cacertsFile="$f"; break; fi; done'; \ | ||
echo 'if [ -z "$cacertsFile" ] || ! [ -f "$cacertsFile" ]; then echo >&2 "error: failed to find cacerts file in $JAVA_HOME"; exit 1; fi'; \ | ||
echo 'trust extract --overwrite --format=java-cacerts --filter=ca-anchors --purpose=server-auth "$cacertsFile"'; \ | ||
} > /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 | ||
javac --version; \ | ||
java --version | ||
|
||
# "jshell" is an interactive REPL for Java (see https://en.wikipedia.org/wiki/JShell) | ||
CMD ["jshell"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
FROM debian:buster-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/* | ||
|
||
# Default to UTF-8 file.encoding | ||
ENV LANG C.UTF-8 | ||
|
||
ENV JAVA_HOME /usr/java/openjdk-14 | ||
ENV PATH $JAVA_HOME/bin:$PATH | ||
|
||
# backwards compatibility shim | ||
RUN { echo '#/bin/sh'; echo 'echo "$JAVA_HOME"'; } > /usr/local/bin/docker-java-home && chmod +x /usr/local/bin/docker-java-home && [ "$JAVA_HOME" = "$(docker-java-home)" ] | ||
|
||
# https://jdk.java.net/ | ||
ENV JAVA_VERSION 14-ea+14 | ||
ENV JAVA_URL https://download.java.net/java/early_access/jdk14/14/GPL/openjdk-14-ea+14_linux-x64_bin.tar.gz | ||
ENV JAVA_SHA256 fc1aed4e0de423dbb27db449b63b25c61b06b80e275f7ef665cce6c61e736726 | ||
|
||
RUN set -eux; \ | ||
\ | ||
savedAptMark="$(apt-mark showmanual)"; \ | ||
apt-get update; \ | ||
apt-get install -y --no-install-recommends \ | ||
wget \ | ||
; \ | ||
rm -rf /var/lib/apt/lists/*; \ | ||
\ | ||
wget -O openjdk.tgz "$JAVA_URL"; \ | ||
echo "$JAVA_SHA256 */openjdk.tgz" | sha256sum -c -; \ | ||
\ | ||
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 'if ! [ -d "$JAVA_HOME" ]; then echo >&2 "error: missing JAVA_HOME environment variable"; exit 1; fi'; \ | ||
# 8-jdk uses "$JAVA_HOME/jre/lib/security/cacerts" and 8-jre and 11+ uses "$JAVA_HOME/lib/security/cacerts" directly (no "jre" directory) | ||
echo 'cacertsFile=; for f in "$JAVA_HOME/lib/security/cacerts" "$JAVA_HOME/jre/lib/security/cacerts"; do if [ -e "$f" ]; then cacertsFile="$f"; break; fi; done'; \ | ||
echo 'if [ -z "$cacertsFile" ] || ! [ -f "$cacertsFile" ]; then echo >&2 "error: failed to find cacerts file in $JAVA_HOME"; exit 1; fi'; \ | ||
echo 'trust extract --overwrite --format=java-cacerts --filter=ca-anchors --purpose=server-auth "$cacertsFile"'; \ | ||
} > /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 | ||
javac --version; \ | ||
java --version | ||
|
||
# "jshell" is an interactive REPL for Java (see https://en.wikipedia.org/wiki/JShell) | ||
CMD ["jshell"] |
Oops, something went wrong.