-
Notifications
You must be signed in to change notification settings - Fork 353
Document how to generate a native image from Spring Boot executable JAR #736
Comments
That said, native image creation being designed to be run on CI/CD platform and given the fact that most containers are CPU architecture specific, I see some value in providing the capability to turn a Spring Boot executable JAR to a native image. Just not sure how we could/should implement that. |
Maybe |
Yes, that's correct. But spring-boot:build-image goal generates OCI image with native image application. Sometimes I want to build OCI (Docker) image by myself. In that case I just need a goal to compile native image but Spring Boot plugin doesn't support that now. |
For that you can use |
Yes, but I will get fallback image, because unfortunately Native Image Builder doesn't recognize and support Spring Boot JAR Layout. So I will need JDK/JRE to run it. |
I mean from sources not the executable JAR (btw we disable fallback in Spring Native). |
Hi
We would like to generate native image by native-image utility in Dockerfile:
native-image -jar custom-spring-boot.jar
But it seems that in generated fat jar META-INF/native-image folder is not root as described in GraalVM documentation:
https://docs.oracle.com/en/graalvm/enterprise/20/docs/reference-manual/native-image/BuildConfiguration/
It's located under BOOT-INF/classes and native-image is unable to detect it. Whereas Micronaut (and Micronaut plugins) create META-INF/native-image in the root folder in the generated jar.
So the question is: is it possible to generate GraalVM native image (using plugin or by another approach)?
The text was updated successfully, but these errors were encountered: