Skip to content

fbuetler/vertx-graalvm-native-image-test

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vert.x Web App as Native Image with GraalVM

This is a basic test project which uses GraalVM / Substrate VM VM to build a native image of a Vert.x Web application.

Build/Reproduce

Build the app as usual (For this you need to have the GraalVM installed locally. Its not more than downloading and unpacking a tar)

./mvnw clean package

Collect reflection configurations (by triggering code paths i.e visit http://localhost:8080) Note: the reflection configurations are saved when the process is stopped.

/path/to/graalvm/bin/java \
-agentlib:native-image-agent=config-output-dir=src/main/resources/META-INF/native-image/reflect-config \
-jar target/vertx-web-native-0.0.1-SNAPSHOT-fat.jar

Build the app again so the reflection configurations are included in the uber jar Note: Other configuration parameters can either be added directly as CLI flag to the native-image command in the Dockerfile or to the native-image.properties.

./mvnw clean package

Build the app as a native image and run it

docker build -t local/vertx-web-native .
docker run -it --rm --name vertx-web-native -p 8080:8080 local/vertx-web-native

About

GraalVM - Substrate VM - Test project for Vert.x

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 76.6%
  • Java 23.4%