Hey everyone! I'm pretty new to Docker and I'm running multiple containers on my NAS using Docker Compose. After a power failure, I noticed that while some of my containers restart automatically, others do not, even though all of them are configured with `restart: unless-stopped`. I'm trying to figure out why this is happening. Is there something about how different images handle the `unless-stopped` option? What configuration should I use to ensure all my containers start up automatically after a power outage? Any insights would be really appreciated!
1 Answer
It sounds like your Docker containers might be starting too early, especially if they rely on other services that take longer to boot up, like network mounts or external volumes. The `unless-stopped` policy usually works, but with power failures, it can behave oddly. It might not trigger correctly after a reboot if those dependencies aren’t ready yet.
That's true! The docs mention that only the `always` restart policy guarantees restarts when the Docker daemon comes back online. Maybe you're running into some kind of dependency issue? If you can share some logs, it might give us more info!