From d2b292c930e05492629e37a7a132803461a0a0e0 Mon Sep 17 00:00:00 2001 From: Maurizio Turatti Date: Mon, 18 Sep 2023 19:50:14 +0200 Subject: [PATCH] Update graalvm.md --- docs/graalvm.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/graalvm.md b/docs/graalvm.md index 2dddf65a..fbdaea96 100644 --- a/docs/graalvm.md +++ b/docs/graalvm.md @@ -158,6 +158,16 @@ In order to use Java or Kotlin plugins on RESTHeart native you must build them a Refer to [Deploy Java Plugins On Restheart Native](https://restheart.org/docs/plugins/deploy/#deploy-java-plugins-on-restheart-native) for detailed instructions on how to do it. +## build native image + +Build image for local OS + +```bash +$ ./mvnw clean package -Pnative -DskipTests +``` + +__Note__: Linux needs to use the `G1` garbage collector. This is obtained by passing the `-Dnative.gc="--gc=G1"` property to maven. + ## A docker image to build Linux native images [SoftInstigate](https://softinstigate.com) maintains the Debian based, docker image [softinstigate/graalvm-maven](https://github.com/SoftInstigate/graalvm-maven-docker) with GraalVM and Maven and `native-image`. @@ -175,7 +185,9 @@ $ docker run -it --rm \ -v "$PWD":/opt/app \ -v "$HOME"/.m2:/root/.m2 \ softinstigate/graalvm-maven \ - clean package -Pnative + clean package -Pnative -DskipTests -Dnative.gc="--gc=G1" ``` +native-image arguments are defined in [this file](https://github.com/SoftInstigate/restheart/blob/master/core/src/main/resources/META-INF/native-image/org.restheart/restheart/native-image.properties). +