Description
This lab will walk you through the process of building a Spring application, making a native executable from it with GraalVM Native Image, and then containerising it. Using a native executable created with GraalVM Native Image allows you to reduce application start-up times, get low resource usage and generate much smaller containers.
You will also learn how to create small Distroless containers to package your GraalVM Native Image native executables in, allowing you to shrink your Docker Images even further!
In this lab you will:
- Add a basic Spring Boot application to a Docker Image and run it
- Build a native executable from this application, using GraalVM Native Image
- Add the native executable to a Docker Image
- Shrink your application docker image size with GraalVM Native Image & Distroless containers
- See how to use the GraalVM Native Build tools, Maven Plugin
GraalVM Native Image makes it possible to compile any Java application ahead-of-time into a native executable that starts almost instantaneously, provides peak performance with no warmup, and requires less memory and less CPU. It's perfect for containerized workloads and microservices—which is why it has been embraced by Micronaut, Spring Boot, Helidon, and Quarkus.
Expected Time to Complete
90 mins
Intended Audience
Application Developer, DevOps Engineer
Level
Intermediate
Products/Services
GraalVM Enterprise, Cloud Infrastructure, Oracle Linux
Technology
Native Image, Java, Compute
Change-log
- March 10, 2022 - Initial version
Acknowledgements
- Owners - Kristian Foster, Olga Gupalo
- Contributors - Ewan Slater, Shaun Smith
- Luna Lab Owners - Olga Gupalo