Skip to content

Instantly share code, notes, and snippets.

@bastichelaar
Created May 8, 2015 08:13
Show Gist options
  • Save bastichelaar/364e14986fcc30e9c293 to your computer and use it in GitHub Desktop.
Save bastichelaar/364e14986fcc30e9c293 to your computer and use it in GitHub Desktop.
FROM alpine:3.1
MAINTAINER Vladimir Krivosheev <[email protected]>
ENV JAVA_VERSION 8
ENV JAVA_UPDATE 45
ENV JAVA_BUILD 14
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" && \
apk add --allow-untrusted glibc-2.21-r2.apk && \
wget "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-bin-2.21-r2.apk && \
/usr/glibc/usr/bin/ldconfig /lib /usr/glibc/usr/lib && \
wget --header "Cookie: oraclelicense=accept-securebackup-cookie;" \
"http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION}u${JAVA_UPDATE}-b${JAVA_BUILD}/jdk-${JAVA_VERSION}u${JAVA_UPDATE}-linux-x64.tar.gz" && \
tar zxf jdk-${JAVA_VERSION}u${JAVA_UPDATE}-linux-x64.tar.gz && \
apk del curl ca-certificates && \
mv jdk1.${JAVA_VERSION}.0_${JAVA_UPDATE}/jre /jre && \
rm /jre/bin/jjs && \
rm /jre/bin/keytool && \
rm /jre/bin/orbd && \
rm /jre/bin/pack200 && \
rm /jre/bin/policytool && \
rm /jre/bin/rmid && \
rm /jre/bin/rmiregistry && \
rm /jre/bin/servertool && \
rm /jre/bin/tnameserv && \
rm /jre/bin/unpack200 && \
rm /jre/lib/ext/nashorn.jar && \
rm /jre/lib/jfr.jar && \
rm -rf /jre/lib/jfr && \
rm -rf /jre/lib/oblique-fonts && \
rm -rf /tmp/* /var/cache/apk/*
ENV JAVA_HOME /jre
ENV PATH ${PATH}:${JAVA_HOME}/bin
ENV LANG C.UTF-8
ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/urandom"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment