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.
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.
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.
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.
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:
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.
enter the docker machine:
docker exec -it testapp bash
enter the /var/test folder and run the app:
dotnet test.dll
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With