albhe
(Albhe)
November 14, 2024, 3:50pm
1
Hello,
I have DockerDesktop 4.35.1 running and see the following behavior on Win 10 running DockerDesktop/WSL2 with distro Ubuntu.
If I reboot the complete Windows host some containers (that were running before) are in exited state after reboot, some are started automatically.
If I reboot only DockerDesktop all containers are running after.
In the docker-compose.yml file all containers have “restart: unless-stopped” set.
Does anyone maybe have an idea how to solve this?
Thanks and bye, Peter
albhe
(Albhe)
December 3, 2024, 11:17am
3
Hello,
I updated Docker Desktop to version 4.36.0 and I see the same problem.
I also set all containers to restart: always but this doesn’t solve the problem.
In the container logs I see nothing that could be the reason
Does anyone maybe have another idea?
Thanks and bye, Peter
rimelek
(Ákos Takács)
December 3, 2024, 7:21pm
4
Hmm… “always” should mean “always”. Containers could fail and constantly restart, but not remaining stopped.
When you changed the restart policy to always, did you run docker compose up -d
again?
You could check the restart policy of the container that yu see stopped this way:
docker container inspect CONTAINERNAME --format '{{ json .HostConfig.RestartPolicy }}'
It should return a json like this:
{"Name":"always","MaximumRetryCount":0}
As you cans ee, there is a MaximumRetryCount. If it is set, if some containers have dependencies that are not running yet or not ready for connection, the container could fail too many times. If the value is 0, the container should always restart and you should see it is restarting and not that it is stopped.
1 Like
albhe
(Albhe)
December 4, 2024, 9:29am
5
Hello Rimelek,
yes, after changing restart policy to restart: always I did run “docker compose up -d” again
And I checked the MaximumRetryCount, it is 0 for all my containers.
Unfortunately I have no idea where to continue, any idea?
Thanks and bye, Peter