Docker Community Forums

Share and learn in the Docker community.

Docker restart=on:failure:10

docker

(Tallandtree) #1

Docker host Environment:
Fedora 21, Docker 1.9.0.
What puzzles me:
I’ve configured 3 containers with --restart=on-failure:10. When I restart docker (systemctl restart docker),
2 of the containers are restarted, the third doesn’t. I didn’t expect any containers to restart as according to the --restart=on:failure documentation, they should only restart if exited with an error.
So, question: why do the other containers restart. One of the restarting containers is based on registry:2. Run as follows:
docker run -d --restart=on-failure:10 --net cm-network --name registry -v /data/docker/registry:/var/lib/registry:Z -e SEARCH_BACKEND=sqlalchemy registry:2.
Snippets from “docker inspect registry” after systemctl restart docker:
"RestartCount": 0, ... "RestartPolicy": { "Name": "on-failure", "MaximumRetryCount": 10 },
It should not restart in my opinion. Or am I missing something?