-
Hi, So I have a container (Immich server) whose composition is defined as:
So I would expect docker-compose to restart this container always. But I see:
So the container looks like exited with a non-zero exit status 24h ago... and I cannot see any attempt by docker to restart it in the last 24 hours... What happened 24 hours ago? I rebooted the host. And I also know why the container was not successfully started immediately after boot: it had to do with some temporary network issue and the fact that e.g. the "photos_nas" volume is actually a remote SMB mount.
So I understand that last time (24h ago) docker tried to start this container, it was unable to mount the remote folder. The network issue is gone now and if I do a "docker compose up -d" in the folder where the Immich docker composition is defined, the container comes up again (and stays up). This question is also actually connected with #542 because whatever is the answer, I think I will need somehow to work around this docker issue and I would like not to bypass doco-cd and mess with the docker compositions it's supposed to own, but rather use some API exposed by doco-cd to work around docker issues. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
The restart policy only starts working when the container has started successfully before to prevent restart loops. Since the container could not start properly after you rebooted the host, the docker engine never tried to restart the container. |
Beta Was this translation helpful? Give feedback.
The restart policy only starts working when the container has started successfully before to prevent restart loops. Since the container could not start properly after you rebooted the host, the docker engine never tried to restart the container.
https://docs.docker.com/engine/containers/start-containers-automatically/#restart-policy-details