Skip to content

Commit 36cdb41

Browse files
authored
Merge pull request #186 from risdenk/openjdk-11
Add OpenJDK 11 variants based on experimental
2 parents ed5f4f4 + 02a4991 commit 36cdb41

File tree

6 files changed

+295
-1
lines changed

6 files changed

+295
-1
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ language: bash
22
services: docker
33

44
env:
5+
- VERSION=11-jre
6+
- VERSION=11-jre VARIANT=slim
7+
- VERSION=11-jdk
8+
- VERSION=11-jdk VARIANT=slim
59
- VERSION=10-jre
610
- VERSION=10-jre VARIANT=slim
711
- VERSION=10-jdk

11-jdk/Dockerfile

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
7+
FROM buildpack-deps:sid-scm
8+
9+
# A few reasons for installing distribution-provided OpenJDK:
10+
#
11+
# 1. Oracle. Licensing prevents us from redistributing the official JDK.
12+
#
13+
# 2. Compiling OpenJDK also requires the JDK to be installed, and it gets
14+
# really hairy.
15+
#
16+
# For some sample build times, see Debian's buildd logs:
17+
# https://buildd.debian.org/status/logs.php?pkg=openjdk-11
18+
19+
RUN apt-get update && apt-get install -y --no-install-recommends \
20+
bzip2 \
21+
unzip \
22+
xz-utils \
23+
&& rm -rf /var/lib/apt/lists/*
24+
25+
# Default to UTF-8 file.encoding
26+
ENV LANG C.UTF-8
27+
28+
# add a simple script that can auto-detect the appropriate JAVA_HOME value
29+
# based on whether the JDK or only the JRE is installed
30+
RUN { \
31+
echo '#!/bin/sh'; \
32+
echo 'set -e'; \
33+
echo; \
34+
echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
35+
} > /usr/local/bin/docker-java-home \
36+
&& chmod +x /usr/local/bin/docker-java-home
37+
38+
# do some fancy footwork to create a JAVA_HOME that's cross-architecture-safe
39+
RUN ln -svT "/usr/lib/jvm/java-11-openjdk-$(dpkg --print-architecture)" /docker-java-home
40+
ENV JAVA_HOME /docker-java-home
41+
42+
ENV JAVA_VERSION 11-ea+9
43+
ENV JAVA_DEBIAN_VERSION 11~9-1
44+
45+
RUN set -ex; \
46+
\
47+
# deal with slim variants not having man page directories (which causes "update-alternatives" to fail)
48+
if [ ! -d /usr/share/man/man1 ]; then \
49+
mkdir -p /usr/share/man/man1; \
50+
fi; \
51+
\
52+
apt-get update; \
53+
apt-get install -y \
54+
openjdk-11-jdk="$JAVA_DEBIAN_VERSION" \
55+
; \
56+
rm -rf /var/lib/apt/lists/*; \
57+
\
58+
# verify that "docker-java-home" returns what we expect
59+
[ "$(readlink -f "$JAVA_HOME")" = "$(docker-java-home)" ]; \
60+
\
61+
# update-alternatives so that future installs of other OpenJDK versions don't change /usr/bin/java
62+
update-alternatives --get-selections | awk -v home="$(readlink -f "$JAVA_HOME")" 'index($3, home) == 1 { $2 = "manual"; print | "update-alternatives --set-selections" }'; \
63+
# ... and verify that it actually worked for one of the alternatives we care about
64+
update-alternatives --query java | grep -q 'Status: manual'
65+
66+
# https://docs.oracle.com/javase/9/tools/jshell.htm
67+
# https://en.wikipedia.org/wiki/JShell
68+
CMD ["jshell"]
69+
70+
# If you're reading this and have any feedback on how this image could be
71+
# improved, please open an issue or a pull request so we can discuss it!
72+
#
73+
# https://github.com/docker-library/openjdk/issues

11-jdk/slim/Dockerfile

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
7+
FROM debian:sid-slim
8+
9+
# A few reasons for installing distribution-provided OpenJDK:
10+
#
11+
# 1. Oracle. Licensing prevents us from redistributing the official JDK.
12+
#
13+
# 2. Compiling OpenJDK also requires the JDK to be installed, and it gets
14+
# really hairy.
15+
#
16+
# For some sample build times, see Debian's buildd logs:
17+
# https://buildd.debian.org/status/logs.php?pkg=openjdk-11
18+
19+
RUN apt-get update && apt-get install -y --no-install-recommends \
20+
bzip2 \
21+
unzip \
22+
xz-utils \
23+
&& rm -rf /var/lib/apt/lists/*
24+
25+
# Default to UTF-8 file.encoding
26+
ENV LANG C.UTF-8
27+
28+
# add a simple script that can auto-detect the appropriate JAVA_HOME value
29+
# based on whether the JDK or only the JRE is installed
30+
RUN { \
31+
echo '#!/bin/sh'; \
32+
echo 'set -e'; \
33+
echo; \
34+
echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
35+
} > /usr/local/bin/docker-java-home \
36+
&& chmod +x /usr/local/bin/docker-java-home
37+
38+
# do some fancy footwork to create a JAVA_HOME that's cross-architecture-safe
39+
RUN ln -svT "/usr/lib/jvm/java-11-openjdk-$(dpkg --print-architecture)" /docker-java-home
40+
ENV JAVA_HOME /docker-java-home
41+
42+
ENV JAVA_VERSION 11-ea+9
43+
ENV JAVA_DEBIAN_VERSION 11~9-1
44+
45+
RUN set -ex; \
46+
\
47+
# deal with slim variants not having man page directories (which causes "update-alternatives" to fail)
48+
if [ ! -d /usr/share/man/man1 ]; then \
49+
mkdir -p /usr/share/man/man1; \
50+
fi; \
51+
\
52+
apt-get update; \
53+
apt-get install -y \
54+
openjdk-11-jdk="$JAVA_DEBIAN_VERSION" \
55+
; \
56+
rm -rf /var/lib/apt/lists/*; \
57+
\
58+
# verify that "docker-java-home" returns what we expect
59+
[ "$(readlink -f "$JAVA_HOME")" = "$(docker-java-home)" ]; \
60+
\
61+
# update-alternatives so that future installs of other OpenJDK versions don't change /usr/bin/java
62+
update-alternatives --get-selections | awk -v home="$(readlink -f "$JAVA_HOME")" 'index($3, home) == 1 { $2 = "manual"; print | "update-alternatives --set-selections" }'; \
63+
# ... and verify that it actually worked for one of the alternatives we care about
64+
update-alternatives --query java | grep -q 'Status: manual'
65+
66+
# https://docs.oracle.com/javase/9/tools/jshell.htm
67+
# https://en.wikipedia.org/wiki/JShell
68+
CMD ["jshell"]
69+
70+
# If you're reading this and have any feedback on how this image could be
71+
# improved, please open an issue or a pull request so we can discuss it!
72+
#
73+
# https://github.com/docker-library/openjdk/issues

11-jre/Dockerfile

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
7+
FROM buildpack-deps:sid-curl
8+
9+
# A few reasons for installing distribution-provided OpenJDK:
10+
#
11+
# 1. Oracle. Licensing prevents us from redistributing the official JDK.
12+
#
13+
# 2. Compiling OpenJDK also requires the JDK to be installed, and it gets
14+
# really hairy.
15+
#
16+
# For some sample build times, see Debian's buildd logs:
17+
# https://buildd.debian.org/status/logs.php?pkg=openjdk-11
18+
19+
RUN apt-get update && apt-get install -y --no-install-recommends \
20+
bzip2 \
21+
unzip \
22+
xz-utils \
23+
&& rm -rf /var/lib/apt/lists/*
24+
25+
# Default to UTF-8 file.encoding
26+
ENV LANG C.UTF-8
27+
28+
# add a simple script that can auto-detect the appropriate JAVA_HOME value
29+
# based on whether the JDK or only the JRE is installed
30+
RUN { \
31+
echo '#!/bin/sh'; \
32+
echo 'set -e'; \
33+
echo; \
34+
echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
35+
} > /usr/local/bin/docker-java-home \
36+
&& chmod +x /usr/local/bin/docker-java-home
37+
38+
# do some fancy footwork to create a JAVA_HOME that's cross-architecture-safe
39+
RUN ln -svT "/usr/lib/jvm/java-11-openjdk-$(dpkg --print-architecture)" /docker-java-home
40+
ENV JAVA_HOME /docker-java-home
41+
42+
ENV JAVA_VERSION 11-ea+9
43+
ENV JAVA_DEBIAN_VERSION 11~9-1
44+
45+
RUN set -ex; \
46+
\
47+
# deal with slim variants not having man page directories (which causes "update-alternatives" to fail)
48+
if [ ! -d /usr/share/man/man1 ]; then \
49+
mkdir -p /usr/share/man/man1; \
50+
fi; \
51+
\
52+
apt-get update; \
53+
apt-get install -y \
54+
openjdk-11-jre="$JAVA_DEBIAN_VERSION" \
55+
; \
56+
rm -rf /var/lib/apt/lists/*; \
57+
\
58+
# verify that "docker-java-home" returns what we expect
59+
[ "$(readlink -f "$JAVA_HOME")" = "$(docker-java-home)" ]; \
60+
\
61+
# update-alternatives so that future installs of other OpenJDK versions don't change /usr/bin/java
62+
update-alternatives --get-selections | awk -v home="$(readlink -f "$JAVA_HOME")" 'index($3, home) == 1 { $2 = "manual"; print | "update-alternatives --set-selections" }'; \
63+
# ... and verify that it actually worked for one of the alternatives we care about
64+
update-alternatives --query java | grep -q 'Status: manual'
65+
66+
# If you're reading this and have any feedback on how this image could be
67+
# improved, please open an issue or a pull request so we can discuss it!
68+
#
69+
# https://github.com/docker-library/openjdk/issues

11-jre/slim/Dockerfile

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#
2+
# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+
#
4+
# PLEASE DO NOT EDIT IT DIRECTLY.
5+
#
6+
7+
FROM debian:sid-slim
8+
9+
# A few reasons for installing distribution-provided OpenJDK:
10+
#
11+
# 1. Oracle. Licensing prevents us from redistributing the official JDK.
12+
#
13+
# 2. Compiling OpenJDK also requires the JDK to be installed, and it gets
14+
# really hairy.
15+
#
16+
# For some sample build times, see Debian's buildd logs:
17+
# https://buildd.debian.org/status/logs.php?pkg=openjdk-11
18+
19+
RUN apt-get update && apt-get install -y --no-install-recommends \
20+
bzip2 \
21+
unzip \
22+
xz-utils \
23+
&& rm -rf /var/lib/apt/lists/*
24+
25+
# Default to UTF-8 file.encoding
26+
ENV LANG C.UTF-8
27+
28+
# add a simple script that can auto-detect the appropriate JAVA_HOME value
29+
# based on whether the JDK or only the JRE is installed
30+
RUN { \
31+
echo '#!/bin/sh'; \
32+
echo 'set -e'; \
33+
echo; \
34+
echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
35+
} > /usr/local/bin/docker-java-home \
36+
&& chmod +x /usr/local/bin/docker-java-home
37+
38+
# do some fancy footwork to create a JAVA_HOME that's cross-architecture-safe
39+
RUN ln -svT "/usr/lib/jvm/java-11-openjdk-$(dpkg --print-architecture)" /docker-java-home
40+
ENV JAVA_HOME /docker-java-home
41+
42+
ENV JAVA_VERSION 11-ea+9
43+
ENV JAVA_DEBIAN_VERSION 11~9-1
44+
45+
RUN set -ex; \
46+
\
47+
# deal with slim variants not having man page directories (which causes "update-alternatives" to fail)
48+
if [ ! -d /usr/share/man/man1 ]; then \
49+
mkdir -p /usr/share/man/man1; \
50+
fi; \
51+
\
52+
apt-get update; \
53+
apt-get install -y \
54+
openjdk-11-jre-headless="$JAVA_DEBIAN_VERSION" \
55+
; \
56+
rm -rf /var/lib/apt/lists/*; \
57+
\
58+
# verify that "docker-java-home" returns what we expect
59+
[ "$(readlink -f "$JAVA_HOME")" = "$(docker-java-home)" ]; \
60+
\
61+
# update-alternatives so that future installs of other OpenJDK versions don't change /usr/bin/java
62+
update-alternatives --get-selections | awk -v home="$(readlink -f "$JAVA_HOME")" 'index($3, home) == 1 { $2 = "manual"; print | "update-alternatives --set-selections" }'; \
63+
# ... and verify that it actually worked for one of the alternatives we care about
64+
update-alternatives --query java | grep -q 'Status: manual'
65+
66+
# If you're reading this and have any feedback on how this image could be
67+
# improved, please open an issue or a pull request so we can discuss it!
68+
#
69+
# https://github.com/docker-library/openjdk/issues

update.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ declare -A suites=(
1818
[8]='stretch'
1919
[9]='sid'
2020
[10]='sid'
21+
[11]='sid'
2122
)
2223
declare -A alpineVersions=(
2324
[7]='3.7'
@@ -27,7 +28,7 @@ declare -A alpineVersions=(
2728

2829
declare -A addSuites=(
2930
# there is no "buildpack-deps:experimental-xxx"
30-
[10]='experimental'
31+
#[11]='experimental'
3132
)
3233

3334
declare -A buildpackDepsVariants=(
@@ -193,6 +194,11 @@ for version in "${versions[@]}"; do
193194
# update Debian's "10~39" to "10-ea+39" (matching http://jdk.java.net/10/)
194195
fullVersion="${fullVersion//10$tilde/10-ea+}"
195196
;;
197+
11)
198+
# update Debian's "11~8" to "11-ea+8" (matching http://jdk.java.net/11/)
199+
fullVersion="${fullVersion//11$tilde/11-ea+}"
200+
;;
201+
196202
esac
197203
fullVersion="${fullVersion//$tilde/-}"
198204

0 commit comments

Comments
 (0)