This project shows how you can build a tiny Docker image with a custom modular Java run-time image for your app.
You will need at least Java 9: This project uses jlink to assemble modules and their dependencies into a custom Java run-time image.
maven-jlink-plugin is still in alpha version and have some issues:
- The current version avaiable at Maven Central repository (3.0.0-alpha-1) has a bug (See: MJLINK-4). We're using a SNAPSHOT version (3.0.0-alpha-2) and unpredictable errors may occur with SNAPSHOT updates.
- JDK
jmods
folder is always relative tojlink
binary location and the generated Java run-time image may NOT be compatible with the Docker base image (See: MJLINK-6).