Last active
January 3, 2021 13:03
-
-
Save rhuss/6d3c0c687fb4ec39c3e4 to your computer and use it in GitHub Desktop.
The Holy Grail of a Minimal, Headless, OpenJDK JRE 8
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
# Build for 206 MB JRE 1.8.0_60 (192 MB in size) with Alping and glibc | |
FROM alpine:3.2 | |
ENV JRE=jre1.8.0_60 \ | |
JAVA_HOME=/opt/jre | |
# That's the an EA from OpenJDK.net | |
# Courtesy to https://github.com/frol/docker-alpine-oraclejdk8 from where the setup of glibc is borrowed | |
RUN apk add --update wget ca-certificates && \ | |
cd /tmp && \ | |
wget "https://circle-artifacts.com/gh/andyshinn/alpine-pkg-glibc/6/artifacts/0/home/ubuntu/alpine-pkg-glibc/packages/x86_64/glibc-2.21-r2.apk" \ | |
"https://circle-artifacts.com/gh/andyshinn/alpine-pkg-glibc/6/artifacts/0/home/ubuntu/alpine-pkg-glibc/packages/x86_64/glibc-bin-2.21-r2.apk" && \ | |
apk add --allow-untrusted glibc-2.21-r2.apk glibc-bin-2.21-r2.apk && \ | |
/usr/glibc/usr/bin/ldconfig /lib /usr/glibc/usr/lib && \ | |
echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf && \ | |
mkdir /opt && \ | |
wget http://www.java.net/download/jdk8u60/archive/b18/binaries/jre-8u60-ea-bin-b18-linux-x64-02_jun_2015.tar.gz -O /tmp/${JRE}.tgz && \ | |
cd /opt && tar zxvf /tmp/${JRE}.tgz && \ | |
ln -s /opt/${JRE} /opt/jre && \ | |
ln -s /opt/jre/bin/java /usr/bin/java && \ | |
apk del wget ca-certificates && \ | |
cd /opt/jre/lib/amd64 && rm libjavafx_* libjfx* libfx* && \ | |
cd /opt/jre/lib/ && rm -rf ext/jfxrt.jar jfxswt.jar javafx.properties font* && \ | |
rm /tmp/* /var/cache/apk/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oracle JDK is not working with musl, see this issue.
Alpine's OpenJDK build seems to be fine with musl (and w/o glibc), I'm running a artifactory instance with it.