It seems to me the executable created by the native image has at least a dependency to a shell. I tried to add the executable to a Docker image FROM scratch and it didn't launch.
Since the native image is a black box, it would be great to explicitly list what requirements are expected - thus we could embed the executable in the smallest Docker image possible.
To be a bit more precise, this is the message I have when I add the executable in a FROM scratch container and try to launch it:
OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory": unknown
glibc is required.
Correct, I have to use an enhanced version of Alpine that contains glibc.
native-image --static does the trick too.
Might be. But I need a shell and cannot use FROM scratch
@nfrankel you don't. I've just used FROM scratch there https://hub.docker.com/layers/greut/hello-java/static/images/sha256-922fe463a2760ad99674b49c3563f0e3a9000b8bfbeb95b5f384a70210d028f2
I confirm. Changing from ENTRYPOINT operator to ENTRYPOINT ["operator"] allowed me to use FROM scratch.
Thanks for the help @greut
Closing the issue as it's not Graal VM related.
Most helpful comment
glibc is required.