I have linux containers deployed on my windows machine.
This containers have .net core services inside of them.
I have a container with a service A that has special access to the docker hosts.
The job of this service A is to stop/start (or restart) the other services if they stop responding.
Lets say the service B stops responding.
I can detect that this service is not responding, so I stop the container of the service B.
Then I want to start the service B, so I start the container B after a few seconds, but it does not start the service B.
I tried to use restart without any luck.
I also tried to run the Bash command docker exec -it {containerName} ādotnet ./{serviceDll}ā inside of he container B but it does not seem to work.
So When you start/restart the container of service B from service A only that time issue occur.
If you start start service B directly from command prompt, does the serviceB start along with the container?
No, if I stop/start container B from prompt the same issue happens.
It only works if I start the container with a docker run from prompt or I run it from docker compose.
start the container with docker run ⦠or with docker compose.
docker stop
docker start
Now check the logs using docker logs or if you have configured any log file then exec into the container and check the log file if not checked already. You will get some hint from the logs.
That is what I have been doing for testing but not luck.
I start the services with compose.
Then I stop container b, then I start container b.
docker logs return nothing.
The service b has logging into file implemented
For testing reasons, the only thing Service b does is logging a message every 10 seconds.
But after the container gets stopped I dont get any more logging
HelloDockerMaster is the service that starts and stops the containers
ServiceNotResponding is the service that will be on the Stopped/Started container
The container for each service is named ā-containerā (you can see this on dockercompose.yml)
There is logging implemented in both solutions that goes to my machine on āD:\ContainerData\logsā (you can change this path in dockercompose.yml if you need to)
PS. This was created in Microsoft Visual Studio Community 2019