Restarting containers after reboot

We have the problem that our containers don’t restart after a reboot. Adapting the cleanup command to our needs here, we’re able to restart all containers that stopped less than 10 minutes ago:

docker inspect -f '{{.Id}},{{.State.Running}},{{.State.FinishedAt}}' $(docker ps -qa) | \
  awk -F, '$2=="false" && $3 > strftime("%FT%T.000000000Z",systime()-60*10) {print $1;}' | \
  xargs -n1 docker start
1 Like

Is there anything in the docker log that indicates a problem during the shutdown, prior to reboot?

We should look at restart policies in 1.2.0 they may solve this.