1
- FROM buildpack-deps:sid-curl
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
2
8
3
9
# A few problems with compiling Java from source:
4
10
# 1. Oracle. Licensing prevents us from redistributing the official JDK.
@@ -12,6 +18,18 @@ RUN echo 'deb http://httpredir.debian.org/debian experimental main' > /etc/apt/s
12
18
# Default to UTF-8 file.encoding
13
19
ENV LANG C.UTF-8
14
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 "$(dirname "$(readlink -f "$(which javac || which java)")")"' ; \
28
+ } > /usr/local/bin/docker-java-home \
29
+ && chmod +x /usr/local/bin/docker-java-home
30
+
31
+ ENV JAVA_HOME /usr/lib/jvm/java-9-openjdk-amd64
32
+
15
33
ENV JAVA_VERSION 9~b96
16
34
ENV JAVA_DEBIAN_VERSION 9~b96-1
17
35
@@ -24,14 +42,11 @@ RUN set -x \
24
42
&& apt-get install -y \
25
43
openjdk-9-jdk="$JAVA_DEBIAN_VERSION" \
26
44
ca-certificates-java="$CA_CERTIFICATES_JAVA_VERSION" \
27
- && rm -rf /var/lib/apt/lists/*
45
+ && rm -rf /var/lib/apt/lists/* \
46
+ && [ "$JAVA_HOME" = "$(docker-java-home)" ]
28
47
29
48
# see CA_CERTIFICATES_JAVA_VERSION notes above
30
49
RUN /var/lib/dpkg/info/ca-certificates-java.postinst configure
31
50
32
- # see https://bugs.debian.org/793210
33
- # and https://github.com/docker-library/java/issues/46#issuecomment-119026586
34
- RUN apt-get update && apt-get install -y --no-install-recommends libfontconfig1 && rm -rf /var/lib/apt/lists/*
35
-
36
51
# If you're reading this and have any feedback on how this image could be
37
52
# improved, please open an issue or a pull request so we can discuss it!
0 commit comments