0

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.

1 Answer 1

0

Classic way

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

Without GraalVM on your machine (but Linux only)

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

1
  • 1
    This exaclty the documentation that I read: the problem is that doesn't explain the details of what happen when I compile with the parameter -Dquarkus.native.container-build=true;
    – S-Wing
    Mar 21, 2023 at 19:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.