forked from darabi/docker-openwrt-java
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
57 lines (51 loc) · 2.32 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# OpenWrt with a Java installation
#
# Many thanks to the original author:
#
# Jean Blanchard <[email protected]>
#
# cf. https://github.com/jeanblanchard/docker-java
#
FROM mcreations/openwrt-x64:17.01.2
MAINTAINER Kambiz Darabi <[email protected]>
# Java Version
ENV JAVA_VERSION_MAJOR 8
ENV JAVA_VERSION_MINOR 172
ENV JAVA_VERSION_BUILD 11
ENV JAVA_URL_TOKEN a58eab1ec242421181065cdc37240b08
ENV JAVA_PACKAGE server-jre
ENV JNA_VERSION 4.5.1
# Runtime environment
ENV JAVA_HOME /opt/jre
ENV PATH ${PATH}:${JAVA_HOME}/bin
# Download and unarchive Java
RUN curl -kLOH "Cookie: oraclelicense=accept-securebackup-cookie" \
http://download.oracle.com/otn-pub/java/jdk/${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-b${JAVA_VERSION_BUILD}/${JAVA_URL_TOKEN}/${JAVA_PACKAGE}-${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-linux-x64.tar.gz &&\
mkdir /opt &&\
tar -xzf ${JAVA_PACKAGE}-${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-linux-x64.tar.gz -C /opt &&\
cp -r /opt/jdk1.${JAVA_VERSION_MAJOR}.0_${JAVA_VERSION_MINOR}/jre /opt/ &&\
curl -jkLH "Cookie: oraclelicense=accept-securebackup-cookie" -o jce_policy-8.zip http://download.oracle.com/otn-pub/java/jce/8/jce_policy-8.zip &&\
unzip jce_policy-8.zip -d /tmp &&\
cp /tmp/UnlimitedJCEPolicyJDK8/*.jar /opt/jre/lib/security/ &&\
rm -rf jce_policy-8.zip /tmp/UnlimitedJCEPolicyJDK8 &&\
curl -kL -o /opt/jre/lib/ext/jna.jar https://github.com/twall/jna/raw/${JNA_VERSION}/dist/jna.jar &&\
echo "export PATH=\$PATH:${JAVA_HOME}/bin" >> /etc/profile &&\
rm -rf ${JAVA_PACKAGE}-${JAVA_VERSION_MAJOR}u${JAVA_VERSION_MINOR}-linux-x64.tar.gz \
/opt/jdk1.${JAVA_VERSION_MAJOR}.0_${JAVA_VERSION_MINOR}/ \
/opt/jre/lib/plugin.jar \
/opt/jre/lib/ext/jfxrt.jar \
/opt/jre/bin/javaws \
/opt/jre/lib/javaws.jar \
/opt/jre/lib/desktop \
/opt/jre/plugin \
/opt/jre/lib/deploy* \
/opt/jre/lib/*javafx* \
/opt/jre/lib/*jfx* \
/opt/jre/lib/amd64/libdecora_sse.so \
/opt/jre/lib/amd64/libprism_*.so \
/opt/jre/lib/amd64/libfxplugins.so \
/opt/jre/lib/amd64/libglass.so \
/opt/jre/lib/amd64/libgstreamer-lite.so \
/opt/jre/lib/amd64/libjavafx*.so \
/opt/jre/lib/amd64/libjfx*.so
CMD [ "java", "-version" ]