-
Notifications
You must be signed in to change notification settings - Fork 476
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7483400
commit e9243a2
Showing
1 changed file
with
39 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
FROM alpine:3.11 | ||
|
||
RUN apk add --no-cache java-cacerts | ||
|
||
ENV JAVA_HOME /opt/openjdk-16 | ||
ENV PATH $JAVA_HOME/bin:$PATH | ||
|
||
# https://jdk.java.net/ | ||
# > Java Development Kit builds, from Oracle | ||
ENV JAVA_VERSION 16-ea+5 | ||
ENV JAVA_URL https://download.java.net/java/early_access/alpine/5/binaries/openjdk-16-ea+5_linux-x64-musl_bin.tar.gz | ||
ENV JAVA_SHA256 1ec940bea148a7ececda635c209de3836fe4e6511f5d49d4248cf6d52c77aac8 | ||
# "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 | ||
# https://openjdk.java.net/jeps/341 | ||
java -Xshare:dump; \ | ||
\ | ||
# see "java-cacerts" package installed above (which maintains "/etc/ssl/certs/java/cacerts" for us) | ||
rm -rf "$JAVA_HOME/lib/security/cacerts"; \ | ||
ln -sT /etc/ssl/certs/java/cacerts "$JAVA_HOME/lib/security/cacerts"; \ | ||
\ | ||
# 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"] |