The benefits of creating a custom runtime image are:
- [x] Reduction of the number of requirements
- [x] Minimizing the size of the Docker image
- [x] Less friction with new users
该提问来源于开源项目:fonoster/routr
The benefits of creating a custom runtime image are:
该提问来源于开源项目:fonoster/routr
The following steps can be used to create a custom run-time image:
Get the jmods list for the server's dependency with $JAVA_HOME/bin/jdeps --list-deps libs/app.deps.jar
Run jlink agains the module list:
bash
jlink -c --no-man-pages --no-header-files -G \
--module-path $JAVA_HOME/jmods/ \
--add-modules \
jdk.scripting.nashorn,\
jdk.scripting.nashorn.shell,\
java.base,\
java.compiler,\
java.instrument,\
java.logging,\
java.management,\
java.naming,\
java.scripting,\
java.security.jgss,\
java.xml,\
java.xml.bind,\
java.sql,\
java.rmi,\
jdk.sctp \
--output jre
Or in Windows
batch
jlink.exe --output jre-window -c --no-man-pages --no-header-files -G `
--module-path %JAVA_HOME%/jmods `
--add-modules jdk.scripting.nashorn,jdk.scripting.nashorn.shell,java.base,java.compiler,java.instrument,java.logging,java.management,java.naming,java.scripting,java.security.jgss,java.xml,java.xml.bind,java.sql,java.rmi,jdk.sctp
Additional testing must be done to create platform-specific images. Also, the base image for "sipio-docker" does not support JDK9 yet, which makes this task slightly difficult.