-
Notifications
You must be signed in to change notification settings - Fork 476
/
Dockerfile
31 lines (27 loc) · 1.01 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM alpine:3.8
ENV JAVA_HOME /opt/openjdk-12
ENV PATH $JAVA_HOME/bin:$PATH
# http://jdk.java.net/
ENV JAVA_VERSION 12-ea+18
ENV JAVA_URL https://download.java.net/java/early_access/alpine/18/binaries/openjdk-12-ea+18_linux-x64-musl_bin.tar.gz
ENV JAVA_SHA256 418ecbea7eee82241fdb3cacbddb139bd2563d3dd91d556b6e3309ca06a62254
# "For Alpine Linux, builds are produced on a reduced schedule and may not be in sync with the other platforms."
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; \
rm /openjdk.tgz; \
\
# https://github.com/docker-library/openjdk/issues/212#issuecomment-420979840
# http://openjdk.java.net/jeps/341
java -Xshare:dump; \
\
# basic smoke test
java --version; \
javac --version
# https://docs.oracle.com/javase/10/tools/jshell.htm
# https://docs.oracle.com/javase/10/jshell/
# https://en.wikipedia.org/wiki/JShell
CMD ["jshell"]