Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker exiting with status code 139

I have a .Net Core application what it to run on a docker image. I typed in the command line :

docker run -d --net=bridge -it --name=testapp -v /var/test/:/var/test microsoft/aspnetcore-build /bin/bash -c "dotnet /var/test/test.dll"

it is created but it is exiting with a status code 139. What could be the problem.

like image 294
Batman Avatar asked Oct 13 '17 07:10

Batman


People also ask

What is exited status in docker?

Paused - The Docker container has been paused, usually with the command docker pause . Exited - The Docker container has exited, usually because the process inside the container has exited.

How do I troubleshoot an exited docker container?

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.

Why does my container exit?

Your containers can exit due to application issues, resource constraints, or other issues. To prevent your containers from exiting so that your tasks can start, consider the troubleshooting options in the Resolution section.


1 Answers

Instead of running the docker image and running the bash command (-c "dotnet /var/test/test.dll") at the same time, divide it to steps.

For example:

  1. run this command:

    docker run -d --net=bridge -it --name=testapp -v /var/test/:/var/test microsoft/aspnetcore-build
    

    it will run an aspnetcore Image named testapp and map the test file between the your machine and the docker machine.

  2. enter the docker machine:

     docker exec -it testapp bash
    
  3. enter the /var/test folder and run the app:

     dotnet test.dll
    
like image 125
sam saleh Avatar answered Oct 05 '22 19:10

sam saleh