Skip to content

guide native image

devonfw-core edited this page Dec 13, 2022 · 7 revisions

Building a native image

Quarkus provides the ability to create a native executable of the application called native image. Unlike other Java based deployments, a native image will only run on the architecture and operating system it is compiled for. Also, no JVM is needed to run the native-image. This improves the startup time, performance, and efficiency. A distribution of GraalVM is needed. You can find the differences between the available distributions here.

To build your quarkus app as a native-image, you have two options that are described in the following sections.

Build a native executable with GraalVM

To build a Quarkus application, you can install GraalVM locally on your machine, as described below. Therefore, read the basic Quarkus application chapter, or clone the example project provided by devonfw. Follow this chapter from the Quarkus Guide for building a native executable.

Installing GraalVM

A native image can be created locally or through a container environment. To create a native image locally, an installed and configured version of GraalVM is needed. You can follow the installation guide from Quarkus or the guide provided by GraalVM for this.

Build a native executable with GraalVM through container environment

In order to make the build of native images more portable, you can also use your container environment and run the GraalVM inside a container (typically Docker). You can simply install Docker with your devonfw-ide distribution, just follow this description Docker with devonfw-ide. Follow this chapter to build a native Linux image through container runtime.

Configuring the native executable

A list of all configuration properties for a native image can be found here.

Clone this wiki locally