13

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.

Batman
  • 378
  • 1
  • 3
  • 11
  • 3
    Look [here](https://stackoverflow.com/a/35410993/21567): `139` is essentially the running program inside the container failing with Signal 11, which is a segmentation fault `SIGSEGV`. Test your code outside the container, or run it inside with a debugger attached. There are multiple ways to do the later (google ".net core debug inside container" for a list of options). – Christian.K Oct 13 '17 at 09:07

2 Answers2

4

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
    
Nick Jones
  • 4,395
  • 6
  • 33
  • 44
sam saleh
  • 141
  • 1
  • 12
-3

I fixed Docker error 139 in my project by adding a COPY line before my RUN line in Dockerfile:

COPY blueprint/src/main/python/setup.py setup.py
RUN python setup.py
Cees Timmerman
  • 17,623
  • 11
  • 91
  • 124