问题描述
我有一个 .Net Core 应用程序,它可以在 docker 镜像上运行什么.我在命令行中输入:
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"
它已创建,但以状态代码 139 退出.可能是什么问题.
it is created but it is exiting with a status code 139. What could be the problem.
推荐答案
与其同时运行 docker 镜像和运行 bash 命令 (-c "dotnet/var/test/test.dll"),划分它的步骤.
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.
例如:
运行这个命令:
run this command:
docker run -d --net=bridge -it --name=testapp -v /var/test/:/var/test microsoft/aspnetcore-build
它将运行一个名为 testapp 的 aspnetcore 映像,并在您的机器和 docker 机器之间映射测试文件.
it will run an aspnetcore Image named testapp and map the test file between the your machine and the docker machine.
进入docker机器:
enter the docker machine:
docker exec -it testapp bash
进入/var/test 文件夹并运行应用程序:
enter the /var/test folder and run the app:
dotnet test.dll
这篇关于Docker 退出,状态码为 139的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!