Visual Studio 2017/19 Docker Compose命令不会启动容器

时间:2019-04-23 07:13:02

标签: visual-studio docker docker-compose

我有一个docker-compose项目的.NET MVC解决方案。当我在Visual Studio中运行Docker Compose时,可以看到在某些时候启动了容器,并且IP地址出现在日志中:

1>docker-compose  -f "C:\Users\<user>\Source\docker\docker-compose.yml" -p dockercompose18429431017078490850 --no-ansi build
...
version: '2.4'
========== Debugging ==========
========== Debugging ==========
========== Debugging ==========
========== Closing Solution ==========
Shutting down running containers.
========== Debugging ==========
docker ps --filter "status=running" --filter "name=dockercompose18429431017078490850_ocm_" --format {{.ID}} -n 1
bc67076d592a
docker inspect --format="{{range .NetworkSettings.Networks}}{{.IPAddress}} {{end}}" bc67076d592a
172.27.245.15 

还有另一个解决方案,其中包含相同的docker-compose.yml文件和 .NET Core 库(除非我遗漏了smth,这是唯一值得注意的差异)。当我运行此解决方案时,将创建但不启动容器:

docker-compose  -f "C:\Users\<user>\Source\Demo1\docker\docker-compose.yml" -f "C:\Users\<user>\Source\Demo1\docker\obj\Docker\docker-compose.vs.release.g.yml" -p dockercompose14173384417294192453 --no-ansi config
...
version: '2.4'
========== Debugging ==========

容器没问题。我可以从命令行成功运行它们。

我试图在VS 2019和2017的Debug和Release配置中运行它。没运气。有什么线索可能阻止容器在Visual Studio中启动?

更新:我在VS中看到的内容: enter image description here

0 个答案:

没有答案