-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[native-image] Binary execution causes segfault on Alpine linux. #386
Comments
So far, we haven't tested native-images on systems that use musl libc. I'll have a look. |
Hmmm, I cannot reproduce the problem:
Seems to work just fine with the following change in
|
Oh my bad. Of course I need to remove the copy commands otherwise it's no alpine linux anymore. |
For now the following can be used as a workaround
Note that this will provide a glibc within the alpine image which is suboptimal. Currently we do not support linking native images against musl libc. |
I experimented a bit more and it turns out that when I force image building to statically link the binary with the following hack
I'm able to produce a binary that doesn't need a libc at all:
:-) |
Then
and the size of the docker image now equals the size of the native-image
|
@olpaw do you think we should make this "hack" into an option? |
See #394 (comment) |
see #394 (comment) |
Created a simple native image on
Ubuntu
and trying to run it on the latest alpine causessegfault error
.Using this sample project by changing the running image to
alpine:3.7
- https://github.com/JurrianFahner/play-with-graalvm/blob/master/DockerfileSince alpine uses musl libc, I had to make the following workaround to make it executable.
After that the native-images throws
Segmation Fault
errorSo is this (running native-images on alpine) a supported scenario?
The text was updated successfully, but these errors were encountered: