Reputation: 591
I have write a small quarkus application and I create a native executable with the command:
mvn package -Pnative -Dquarkus.native.container-build=true
The process works fine (I'm able to deploy the app inside a docker container and everything works fine), but I don't understand what the packaging process (with the param -Dquarkus.native.container-build=true) does behind the scene (for example, I haven't GraalVm on my pc; how can the process create a native image? Does the process "start" a container with graal, package the java inside the container and then return the artifact?).
Searching online I find only tutorials to create native images for containers that don't explain how the process works.
Thanks for any explanation or suggestion on where to find useful information.
Upvotes: 1
Views: 2670
Reputation: 1350
It's not easy to find documentation about this, could only find seeing the command it executes on the console and seeing the source code
Upvotes: 0
Reputation: 1121
As stated in Quarkus Documentation, you'll need to install and configure GraalVM in order to be able to compile to native.
Mandrel or GraalVM installed and configured appropriately
You'll also need a working C environment
What does having a working C developer environment mean?
On Linux, you will need GCC, and the glibc and zlib headers.
...
On macOS, XCode provides the required dependencies
...
On Windows, you will need to install the Visual Studio 2017 Visual C++ Build Tools
You could also tell quarkus that you don't have GraalVM (and don't want to bother installing it). Quarkus will use your container runtime to get what it needs to do its task. Simply add this param :
-Dquarkus.native.container-build=true
If this build should be done using a container runtime. Unless container-runtime is also set, docker will be used by default. If docker is not available or is an alias to podman, podman will be used instead as the default.
See reference for more info
Upvotes: -1