I have some containers which all of them have the always restart value in the docker-compose file like this:
version: "3.7"
services:
container:
image: ghost:latest
container_name: some_container
restart: always
depends_on:
- ...
ports:
- ...
...
As soon as the OS (Flatcar Linux / CoreOS) has updated itself none of the containers restart. But if I just do $ sudo docker ps
all of the containers starts at once. Whats up with that and how do I fix it so my containers automatically restarts after an update?
EDIT:
Not sure what is unclear about my question, restart: always
is turned on. Unless I'm missing some vital thing in the documentation, this command should restart the container even if the docker daemon is restarted (after an os reboot).
Copy of one my comments from below:
Ok, so help me out here. As you can see in my question, I have restart: always turned on. All these containers are started successfully and are running well. Then the OS updates itself automatically and restarts itself. After this restart the docker daemon is restarted. But for some reasons the containers I had running WITH
RESTART: ALWAYS
turned on DOES NOT START. If I enter my server at this moment, typesudo docker ps
to list my running containers, suddenly all containers are booted up and I see the list. So why wasn't the containers started, even though the daemon is running?
systemctl status docker
to see if systemd started it. – Armet