File tree Expand file tree Collapse file tree 9 files changed +114
-9
lines changed Expand file tree Collapse file tree 9 files changed +114
-9
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,16 @@ RUN apt-get update && apt-get install -y unzip && rm -rf /var/lib/apt/lists/*
16
16
# Default to UTF-8 file.encoding
17
17
ENV LANG C.UTF-8
18
18
19
+ # add a simple script that can auto-detect the appropriate JAVA_HOME value
20
+ # based on whether the JDK or only the JRE is installed
21
+ RUN { \
22
+ echo '#!/bin/bash' ; \
23
+ echo 'set -e' ; \
24
+ echo; \
25
+ echo 'dirname "/usr/libexec/eselect-java"' ; \
26
+ } > /usr/local/bin/docker-java-home \
27
+ && chmod +x /usr/local/bin/docker-java-home
28
+
19
29
ENV JAVA_HOME /usr/lib/jvm/java-6-openjdk-amd64
20
30
21
31
ENV JAVA_VERSION 6b36
@@ -25,7 +35,8 @@ RUN set -x \
25
35
&& apt-get update \
26
36
&& apt-get install -y \
27
37
openjdk-6-jdk="$JAVA_DEBIAN_VERSION" \
28
- && rm -rf /var/lib/apt/lists/*
38
+ && rm -rf /var/lib/apt/lists/* \
39
+ && [ "$JAVA_HOME" = "$(docker-java-home)" ]
29
40
30
41
# If you're reading this and have any feedback on how this image could be
31
42
# improved, please open an issue or a pull request so we can discuss it!
Original file line number Diff line number Diff line change @@ -16,6 +16,16 @@ RUN apt-get update && apt-get install -y unzip && rm -rf /var/lib/apt/lists/*
16
16
# Default to UTF-8 file.encoding
17
17
ENV LANG C.UTF-8
18
18
19
+ # add a simple script that can auto-detect the appropriate JAVA_HOME value
20
+ # based on whether the JDK or only the JRE is installed
21
+ RUN { \
22
+ echo '#!/bin/bash' ; \
23
+ echo 'set -e' ; \
24
+ echo; \
25
+ echo 'dirname "/usr/libexec/eselect-java"' ; \
26
+ } > /usr/local/bin/docker-java-home \
27
+ && chmod +x /usr/local/bin/docker-java-home
28
+
19
29
ENV JAVA_HOME /usr/lib/jvm/java-6-openjdk-amd64/jre
20
30
21
31
ENV JAVA_VERSION 6b36
@@ -25,7 +35,8 @@ RUN set -x \
25
35
&& apt-get update \
26
36
&& apt-get install -y \
27
37
openjdk-6-jre-headless="$JAVA_DEBIAN_VERSION" \
28
- && rm -rf /var/lib/apt/lists/*
38
+ && rm -rf /var/lib/apt/lists/* \
39
+ && [ "$JAVA_HOME" = "$(docker-java-home)" ]
29
40
30
41
# If you're reading this and have any feedback on how this image could be
31
42
# improved, please open an issue or a pull request so we can discuss it!
Original file line number Diff line number Diff line change @@ -16,6 +16,16 @@ RUN apt-get update && apt-get install -y unzip && rm -rf /var/lib/apt/lists/*
16
16
# Default to UTF-8 file.encoding
17
17
ENV LANG C.UTF-8
18
18
19
+ # add a simple script that can auto-detect the appropriate JAVA_HOME value
20
+ # based on whether the JDK or only the JRE is installed
21
+ RUN { \
22
+ echo '#!/bin/bash' ; \
23
+ echo 'set -e' ; \
24
+ echo; \
25
+ echo 'dirname "/usr/libexec/eselect-java"' ; \
26
+ } > /usr/local/bin/docker-java-home \
27
+ && chmod +x /usr/local/bin/docker-java-home
28
+
19
29
ENV JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64
20
30
21
31
ENV JAVA_VERSION 7u91
@@ -25,7 +35,8 @@ RUN set -x \
25
35
&& apt-get update \
26
36
&& apt-get install -y \
27
37
openjdk-7-jdk="$JAVA_DEBIAN_VERSION" \
28
- && rm -rf /var/lib/apt/lists/*
38
+ && rm -rf /var/lib/apt/lists/* \
39
+ && [ "$JAVA_HOME" = "$(docker-java-home)" ]
29
40
30
41
# If you're reading this and have any feedback on how this image could be
31
42
# improved, please open an issue or a pull request so we can discuss it!
Original file line number Diff line number Diff line change @@ -16,6 +16,16 @@ RUN apt-get update && apt-get install -y unzip && rm -rf /var/lib/apt/lists/*
16
16
# Default to UTF-8 file.encoding
17
17
ENV LANG C.UTF-8
18
18
19
+ # add a simple script that can auto-detect the appropriate JAVA_HOME value
20
+ # based on whether the JDK or only the JRE is installed
21
+ RUN { \
22
+ echo '#!/bin/bash' ; \
23
+ echo 'set -e' ; \
24
+ echo; \
25
+ echo 'dirname "/usr/libexec/eselect-java"' ; \
26
+ } > /usr/local/bin/docker-java-home \
27
+ && chmod +x /usr/local/bin/docker-java-home
28
+
19
29
ENV JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64/jre
20
30
21
31
ENV JAVA_VERSION 7u91
@@ -25,7 +35,8 @@ RUN set -x \
25
35
&& apt-get update \
26
36
&& apt-get install -y \
27
37
openjdk-7-jre-headless="$JAVA_DEBIAN_VERSION" \
28
- && rm -rf /var/lib/apt/lists/*
38
+ && rm -rf /var/lib/apt/lists/* \
39
+ && [ "$JAVA_HOME" = "$(docker-java-home)" ]
29
40
30
41
# If you're reading this and have any feedback on how this image could be
31
42
# improved, please open an issue or a pull request so we can discuss it!
Original file line number Diff line number Diff line change @@ -18,6 +18,16 @@ RUN echo 'deb http://httpredir.debian.org/debian jessie-backports main' > /etc/a
18
18
# Default to UTF-8 file.encoding
19
19
ENV LANG C.UTF-8
20
20
21
+ # add a simple script that can auto-detect the appropriate JAVA_HOME value
22
+ # based on whether the JDK or only the JRE is installed
23
+ RUN { \
24
+ echo '#!/bin/bash' ; \
25
+ echo 'set -e' ; \
26
+ echo; \
27
+ echo 'dirname "/usr/libexec/eselect-java"' ; \
28
+ } > /usr/local/bin/docker-java-home \
29
+ && chmod +x /usr/local/bin/docker-java-home
30
+
21
31
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
22
32
23
33
ENV JAVA_VERSION 8u66
@@ -32,7 +42,8 @@ RUN set -x \
32
42
&& apt-get install -y \
33
43
openjdk-8-jdk="$JAVA_DEBIAN_VERSION" \
34
44
ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" \
35
- && rm -rf /var/lib/apt/lists/*
45
+ && rm -rf /var/lib/apt/lists/* \
46
+ && [ "$JAVA_HOME" = "$(docker-java-home)" ]
36
47
37
48
# see CA_CERTIFICATES_JAVA_VERSION notes above
38
49
RUN /var/lib/dpkg/info/ca-certificates-java.postinst configure
Original file line number Diff line number Diff line change @@ -18,6 +18,16 @@ RUN echo 'deb http://httpredir.debian.org/debian jessie-backports main' > /etc/a
18
18
# Default to UTF-8 file.encoding
19
19
ENV LANG C.UTF-8
20
20
21
+ # add a simple script that can auto-detect the appropriate JAVA_HOME value
22
+ # based on whether the JDK or only the JRE is installed
23
+ RUN { \
24
+ echo '#!/bin/bash' ; \
25
+ echo 'set -e' ; \
26
+ echo; \
27
+ echo 'dirname "/usr/libexec/eselect-java"' ; \
28
+ } > /usr/local/bin/docker-java-home \
29
+ && chmod +x /usr/local/bin/docker-java-home
30
+
21
31
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/jre
22
32
23
33
ENV JAVA_VERSION 8u66
@@ -32,7 +42,8 @@ RUN set -x \
32
42
&& apt-get install -y \
33
43
openjdk-8-jre-headless="$JAVA_DEBIAN_VERSION" \
34
44
ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" \
35
- && rm -rf /var/lib/apt/lists/*
45
+ && rm -rf /var/lib/apt/lists/* \
46
+ && [ "$JAVA_HOME" = "$(docker-java-home)" ]
36
47
37
48
# see CA_CERTIFICATES_JAVA_VERSION notes above
38
49
RUN /var/lib/dpkg/info/ca-certificates-java.postinst configure
Original file line number Diff line number Diff line change @@ -18,6 +18,16 @@ RUN echo 'deb http://httpredir.debian.org/debian experimental main' > /etc/apt/s
18
18
# Default to UTF-8 file.encoding
19
19
ENV LANG C.UTF-8
20
20
21
+ # add a simple script that can auto-detect the appropriate JAVA_HOME value
22
+ # based on whether the JDK or only the JRE is installed
23
+ RUN { \
24
+ echo '#!/bin/bash' ; \
25
+ echo 'set -e' ; \
26
+ echo; \
27
+ echo 'dirname "/usr/libexec/eselect-java"' ; \
28
+ } > /usr/local/bin/docker-java-home \
29
+ && chmod +x /usr/local/bin/docker-java-home
30
+
21
31
ENV JAVA_HOME /usr/lib/jvm/java-9-openjdk-amd64
22
32
23
33
ENV JAVA_VERSION 9~b96
@@ -32,7 +42,8 @@ RUN set -x \
32
42
&& apt-get install -y \
33
43
openjdk-9-jdk="$JAVA_DEBIAN_VERSION" \
34
44
ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" \
35
- && rm -rf /var/lib/apt/lists/*
45
+ && rm -rf /var/lib/apt/lists/* \
46
+ && [ "$JAVA_HOME" = "$(docker-java-home)" ]
36
47
37
48
# see CA_CERTIFICATES_JAVA_VERSION notes above
38
49
RUN /var/lib/dpkg/info/ca-certificates-java.postinst configure
Original file line number Diff line number Diff line change @@ -18,6 +18,16 @@ RUN echo 'deb http://httpredir.debian.org/debian experimental main' > /etc/apt/s
18
18
# Default to UTF-8 file.encoding
19
19
ENV LANG C.UTF-8
20
20
21
+ # add a simple script that can auto-detect the appropriate JAVA_HOME value
22
+ # based on whether the JDK or only the JRE is installed
23
+ RUN { \
24
+ echo '#!/bin/bash' ; \
25
+ echo 'set -e' ; \
26
+ echo; \
27
+ echo 'dirname "/usr/libexec/eselect-java"' ; \
28
+ } > /usr/local/bin/docker-java-home \
29
+ && chmod +x /usr/local/bin/docker-java-home
30
+
21
31
ENV JAVA_HOME /usr/lib/jvm/java-9-openjdk-amd64/jre
22
32
23
33
ENV JAVA_VERSION 9~b96
@@ -32,7 +42,8 @@ RUN set -x \
32
42
&& apt-get install -y \
33
43
openjdk-9-jre-headless="$JAVA_DEBIAN_VERSION" \
34
44
ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" \
35
- && rm -rf /var/lib/apt/lists/*
45
+ && rm -rf /var/lib/apt/lists/* \
46
+ && [ "$JAVA_HOME" = "$(docker-java-home)" ]
36
47
37
48
# see CA_CERTIFICATES_JAVA_VERSION notes above
38
49
RUN /var/lib/dpkg/info/ca-certificates-java.postinst configure
Original file line number Diff line number Diff line change @@ -83,6 +83,22 @@ for version in "${versions[@]}"; do
83
83
84
84
# Default to UTF-8 file.encoding
85
85
ENV LANG C.UTF-8
86
+ EOD
87
+
88
+ cat >> " $version /Dockerfile" << EOD
89
+
90
+ # add a simple script that can auto-detect the appropriate JAVA_HOME value
91
+ # based on whether the JDK or only the JRE is installed
92
+ RUN { \\
93
+ echo '#!/bin/bash'; \\
94
+ echo 'set -e'; \\
95
+ echo; \\
96
+ echo 'dirname "$( dirname " $( readlink -f " $( which javac || which java) " ) " ) "'; \\
97
+ } > /usr/local/bin/docker-java-home \\
98
+ && chmod +x /usr/local/bin/docker-java-home
99
+ EOD
100
+
101
+ cat >> " $version /Dockerfile" << -EOD
86
102
87
103
ENV JAVA_HOME $javaHome
88
104
112
128
EOD
113
129
fi
114
130
cat >> " $version /Dockerfile" << EOD
115
- && rm -rf /var/lib/apt/lists/*
131
+ && rm -rf /var/lib/apt/lists/* \\
132
+ && [ "\$ JAVA_HOME" = "\$ (docker-java-home)" ]
116
133
EOD
117
134
118
135
if [ " $needCaHack " ]; then
You can’t perform that action at this time.
0 commit comments