-
Notifications
You must be signed in to change notification settings - Fork 1.7k
native-image fails with segfault in Docker container #624
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
Comments
I changed the base Docker image to:
Which is the same as the one used by the graal image.... and it seems to work (no segfault). So, not sure if this is a bug or I was just using an incompatible kernel?! If so, sorry for the trouble. |
By executing a shell in the Docker container and trying some different requests, it's pretty easy to cause a segfault. For example, start a container shell with:
Then, create a simple request in a local file, then run the "scraper" with that:
Now, try a request to a non-existent server:
So, seems to be an actual bug. |
If you are using a native-image in docker you need to ensure that you base your docker image on an image that uses |
Can you remove |
Funny that you mention that :) Just tried doing it and got the same error when I make a request to a server that can't be found (used host
Requests to servers that exist work fine. In my Mac (without Docker), the same request (also running a native-image) would result in:
So I think this is the case that the native image in Docker is not handling correctly. |
Is this the case even when I use |
It depends. See #571 (comment) |
I am also seeing this bug or something similar when attempting to build an image for Micronaut using docker. Trace is:
|
Hi, I am doing lots of experiments with native-image and I wanted to see if I could get them running inside a tiny Docker image like
scratch
. I used the--static
option so I thought it would not need anything pre-installed in the container image.The native-image works fine in my Mac (without
--static
as it says it can't create static images on Mac).Here's what happened when I tried to run my program in Docker:
I also tried using
alpine
as a base image, but it also got an error:This is the project I am using for tests:
https://github.com/renatoathaydes/rawhttp-scraper/tree/use-graal-js-api/rawhttp-scraper
I tagged the commit with
docker-experiment
so you can check it out easily, if needed.I just go to this folder, run
docker build -t scraper .
, then execute it withdocker run -it scraper get-speakers
(it will try to send a HTTP request tohttp://localhost:9000/java-meetup/speakers
which I know, will not work unless you expose a server in localhost on the container, but I still expected to just see aConnectionException
or something similar).A command that does work (as it just prints help to sysout) is
docker run -it scraper -h
, in case you need to test that.The text was updated successfully, but these errors were encountered: