Docker in Win (Linux containers): docker-compose command fails somehow outside of Visual Studio

白昼怎懂夜的黑 提交于 2020-07-23 06:08:39

问题


I am testing Docker containers, and I managed to create an image, using Visual Studio and Docker Compose, that seems to be OK:

Images:

The image is a .NET Core Console application, very small and simple. It does connect to a Redis server and starts producing some stuff, and logs this to console. This is how it looks if I start the project directly from Visual Studio (no Docker involved):

Now, if I run it via Visual Studio, by setting the "docker-compose" project to Startup, and then pressing the play button on top, that says "Docker Compose", I can see that this command is executed:

docker-compose -f "C:\Git\alfa\AlfaModulesPoc\docker-compose.yml" -f "C:\Git\alfa\AlfaModulesPoc\docker-compose.override.yml" -f "C:\Git\alfa\AlfaModulesPoc\obj\Docker\docker-compose.vs.debug.g.yml" -p dockercompose5247976386926556655 --no-ansi up -d

I now see the Output in VS display the console correctly:

also Docker Desktop shows it:

But, if I run the same command from the command line:

I can see that Docker thinks it is running:

and I then take a look at Docker Desktop, there are no logs being captured any more:

And, the logs are not shown, because it seems that there is no activity at all from the container. I would see data being created in the Redis database, but when started manually from the command prompt, then no data is touched on Redis.

  • Why isn't the container running properly?
  • Can I see any errors, exceptions or something to determine what is going on?

来源:https://stackoverflow.com/questions/62676590/docker-in-win-linux-containers-docker-compose-command-fails-somehow-outside-o

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!