GraalVM images using Buildpacks
Ensure Docker is installed by referring to the details in the Docker documentation (https://docs.docker.com/get-docker/). If you are using Linux, configure Docker to permit non-root users.
Important note
For macOS users, it is advisable to enhance the allocated Docker memory to a minimum of 8 GB and consider adding more CPUs. On Microsoft Windows, ensure optimal performance by enabling the Docker WSL 2 backend (https://docs.docker.com/desktop/wsl/).
In the upcoming sections, we will construct GraalVM images employing Buildpacks
and Gradle
, as well as crafting GraalVM images utilizing Buildpacks
and Maven
.
Building GraalVM images using Buildpacks and Gradle
The AOT tasks are automatically configured by the Spring Boot Gradle plugin when the GraalVM Native Image plugin is applied. Ensure that your Gradle build includes a plugins
block with org.graalvm.buildtools.native
.
For our sample application, we need to add the plugin declaration...