Hello,
I use Docker and docker-compose to start several API projects in one Visual Studio solution.
Since the Docker parameter depends_on
does not wait for those other containers/services to start healthy it is hard to control the order of container execution.
I could override the entrypoint
of one container with a script to check the existence/running of his dependencies.
Docker officially recommends using this bash script "https://github.com/vishnubob/wait-for-it"
Problem (1): It is bash script, how could I use it in a windows container based on mcr.microsoft.com/dotnet/core/aspnet:3.1
... So I wrote an old-school batch file to curl/ping
the url of the dependent service.
Problem (2): The docker-compose implementation of Visual Studio (Debugging) ignores the ENTRYPOINT in the Dockerfile.
To override the entrypoint in Debug mode I have to override the entrypoint in a file named docker-compose.vs.debug.yml
.
But if you do this, you have to make sure the connection to the remote-debugger (msvsmon.exe) is still part of the entrypoint.
Which I have done by coping whats in the docker-compose.vs.debug.g.yml
file, but then other problems occurs.
So before I waste another year of my life ...
My question:
What is the best way in Visual Studio (Debug Mode with docker-compose) to ensure a dependent container is running before starting the actual container ?
Thanks, Sascha