/jlink-distroless-maven-example

Example for jlink-jpackager-maven-plugin how to build a distroless docker image using the Java jlink tool.

Primary LanguageJava

jlink-distroless-maven-example

This project shows how you can build a tiny Docker image based on the google distroless docker base image with a custom modular Java run-time image for your app.

This example is using the link-jpackager-maven-plugin.

For a similar example using the maven-jlink-plugin look at https://github.com/bei/maven-jlink-distroless-example.

After building the docker image you can start it with

docker run agilhard/jlink-distroless-example

Prerequisites

You will need at least Java 9: This project uses jlink to assemble modules and their dependencies into a custom Java run-time image.

The link-jpackager-maven-plugin is not (yet?) available on maven central you must download, compile and install that to your maven Repository before you can use this example.