Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker is exited immediately when runs with error code 139

I have a web api project with running fine when i ran through visual studio, able to build the image also. but when i run using the command

docker run -d -t -p 8000:83 8fbf296e2173

shows no error and the container will be listed in docker ps -a with the status

Exited (139) 1 second ago

Please help to solve this

like image 249
arunraj770 Avatar asked Apr 04 '19 05:04

arunraj770


People also ask

How to fix Docker container exit code 139?

Issue : Docker Container exits on Docker desktop (Windows) with exit code 139. This is a known problem when running Docker desktop with WSL based engine on windows. The culprit is the base OS of your docker image. The Fix is pretty simple. To fix this, You have to Enable vsyscall=emulate in the kernel config to run older base images.

How to fix Docker container exiting error?

Any error in this can exit the container. So, our Support Engineers check the Dockerfile and correct it. For instance, changing the COPY command to AND command can fix this error. Later we need to start this exited container.

What does error code 139 mean?

For anyone's future reference; Docker exit code 139 ( 128 + 11) means that a container received a SIGSEGV. This may be a result of invalid memory reference. Show activity on this post. I faced the same issue while trying to connect to port 1433 from my host to docker (error code 139).

How to fix Docker Run command launch Docker container error?

As we have said, docker run command launch docker container by reading Dockerfile. Any error in this can exit the container. So, our Support Engineers check the Dockerfile and correct it. For instance, changing the COPY command to AND command can fix this error. Later we need to start this exited container.


Video Answer


2 Answers

It's impossible to say what the root cause is without knowing more about the image that is running. But, the Exited (139) basically means the PID 1 of the container was sent SIGKILL. It could be anything, segfault, out of memory, stack overflow, etc.

like image 125
wmorrell Avatar answered Oct 17 '22 14:10

wmorrell


Started using WSL 2 and encountered the same issue. The workaround posted here has resolved things for me: https://github.com/microsoft/WSL/issues/4694#issuecomment-556095344

like image 34
Sam Worley Avatar answered Oct 17 '22 14:10

Sam Worley