I was recently impressed by Spring Boot's native images feature. I considered sharing some information about native images.
I created two simple Spring Boot projects
Apart from the Main class, I used the same controller in both projects.
I used the following command to create docker images.
(Both projects are based on maven)
When I ran both docker images, I was surprised by the application startup time.
There's also a significant difference in the sizes of the two Docker images.
So, What happened after we installed the native plugin?
- Thanks to Spring AOT Process, it performed a code analysis to identify unnecessary code.
- After the code analysis, all unnecessary code was removed, and a native image was created.
Now, This native image is no longer dependent on the JVM and can run without the JVM.
We must thank @graalvmfor making this all possible.