Are there Docker images for specific Java 9 modules?
I guess there should appear base images for FROM java:9, but how would optional modules come, if my base would be from minimal core Java 9 module.
Here is one example:
FROM java:9
COPY /target/myswarmproject-swarm.jar /home/myswarm-swarm.jar
EXPOSE 8080
CMD java -jar /home/myswarmproject-swarm.jar
Previous dockerfile example is for wildfly swarm project which is deployed as .jar into the container.
Here is my implementation, also found at adenix/java:9u181:
FROM ubuntu:16.04
RUN \
apt update && \
apt install -y curl && \
curl -jkL -H "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/9+181/jdk-9_linux-x64_bin.tar.gz -o jdk-9_linux-x64_bin.tar.gz && \
apt remove -y curl && \
apt clean && \
apt -y autoremove && \
rm -rf /var/lib/apt/lists/* && \
tar xvzf jdk-9_linux-x64_bin.tar.gz -C /opt/ && \
rm -rf jdk-9_linux-x64_bin.tar.gz && \
update-alternatives --install /usr/bin/java java /opt/jdk-9/bin/java 100 && \
update-alternatives --install /usr/bin/javac javac /opt/jdk-9/bin/javac 100 && \
update-alternatives --install /usr/bin/jshell jshell /opt/jdk-9/bin/jshell 100
CMD ["jshell"]
You could implement this by either duplicating this Docker file or using FROM adenix/java:9u181 in your Dockerfile.