Reputation: 300
I would like the docker containers to come up
host reboot
or when docker is restarted
on hostOn failure
with maximum retries
. I am aware that the docker restart policies unless-stopped
and always
are in the same direction but I would want them to fail after maximum retries.
Thinking of below steps as a solution
No restart policy
on docker containerssystemd-docker
to restart containers on-failure
and enabled on reboot.is there a better way to do this?
Upvotes: 2
Views: 751
Reputation: 1323973
I would like the docker containers to come up On host reboot or when docker is restarted on host
This is not a complete answer, but know that docker 1.12 will add a daemonless container mode
(PR 23213):
Daemonless Containers
Starting with Docker 1.12 containers can run without Docker or
containerd
running.
This allows the Docker daemon to exit, be upgraded, or recover from a crash without affecting running containers on the system.To enable this functionality you need to add the
--live-restore
flag when launchingdockerd
. This will ensure that Docker does not kill containers on graceful shutdown or on restart leaving the containers running.
Upvotes: 1