问题
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