Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
60 lines (46 sloc) 2.42 KB
FROM frekele/debian:stable
MAINTAINER frekele <leandro@frekele.org>
# Set environment variables for program versions
ENV JDK_VERSION=8
ENV JDK_UPDATE=212
ENV JDK_BUILD=b10
ENV JDK_DISTRO_ARCH=linux-x64
ENV JCE_FOLDER=UnlimitedJCEPolicyJDK$JDK_VERSION
ENV JDK_FOLDER=jdk1.$JDK_VERSION.0_$JDK_UPDATE
ENV JDK_VERSION_UPDATE=$JDK_VERSION'u'$JDK_UPDATE
ENV JDK_VERSION_UPDATE_BUILD=$JDK_VERSION_UPDATE'-'$JDK_BUILD
ENV JDK_VERSION_UPDATE_DISTRO_ARCH=$JDK_VERSION_UPDATE'-'$JDK_DISTRO_ARCH
ENV JAVA_HOME=/opt/java
ENV JRE_SECURITY_FOLDER=$JAVA_HOME/jre/lib/security
ENV SSL_TRUSTED_CERTS_FOLDER=/opt/ssl/trusted
# Change to tmp folder
WORKDIR /tmp
# Download and extract jdk to opt folder
RUN wget --no-check-certificate https://github.com/frekele/oracle-java/releases/download/${JDK_VERSION_UPDATE_BUILD}/jdk-${JDK_VERSION_UPDATE_DISTRO_ARCH}.tar.gz \
&& wget --no-check-certificate https://github.com/frekele/oracle-java/releases/download/${JDK_VERSION_UPDATE_BUILD}/jdk-${JDK_VERSION_UPDATE_DISTRO_ARCH}.tar.gz.md5 \
&& echo "$(cat jdk-${JDK_VERSION_UPDATE_DISTRO_ARCH}.tar.gz.md5) jdk-${JDK_VERSION_UPDATE_DISTRO_ARCH}.tar.gz" | md5sum -c \
&& tar -zvxf jdk-${JDK_VERSION_UPDATE_DISTRO_ARCH}.tar.gz -C /opt \
&& ln -s /opt/${JDK_FOLDER} /opt/java \
&& rm -f jdk-${JDK_VERSION_UPDATE_DISTRO_ARCH}.tar.gz \
&& rm -f jdk-${JDK_VERSION_UPDATE_DISTRO_ARCH}.tar.gz.md5
# Download zip file with java cryptography extension and unzip to jre security folder
RUN wget --no-check-certificate https://github.com/frekele/oracle-java/releases/download/oracle_jce${JDK_VERSION}/jce_policy-${JDK_VERSION}.zip \
&& unzip jce_policy-${JDK_VERSION}.zip \
&& cp ${JCE_FOLDER}/*.jar ${JRE_SECURITY_FOLDER} \
&& rm -f jce_policy-${JDK_VERSION}.zip \
&& rm -rf ${JCE_FOLDER}
# Add executables to path
RUN update-alternatives --install "/usr/bin/java" "java" "/opt/java/bin/java" 1 && \
update-alternatives --set "java" "/opt/java/bin/java" && \
update-alternatives --install "/usr/bin/javac" "javac" "/opt/java/bin/javac" 1 && \
update-alternatives --set "javac" "/opt/java/bin/javac" && \
update-alternatives --install "/usr/bin/keytool" "keytool" "/opt/java/bin/keytool" 1 && \
update-alternatives --set "keytool" "/opt/java/bin/keytool"
# Create trusted ssl certs folder
RUN mkdir -p $SSL_TRUSTED_CERTS_FOLDER
# Mark as volume
VOLUME $SSL_TRUSTED_CERTS_FOLDER
# Add the files
ADD rootfs /
# Change to root folder
WORKDIR /root
You can’t perform that action at this time.