Docker exiting with status code 139

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