A restart policy only takes effect after a container starts successfully. In this case, starting successfully means that the container is up for at least 10 seconds and Docker has started monitoring it. This prevents a container which does not start at all from going into a restart loop.
However, the on-failure setting does not obey this. A failed container will keep restarting even when alive for less than 10s.
Description
The Docker docs states:
However, the
on-failure
setting does not obey this. A failed container will keep restarting even when alive for less than 10s.Related issues:
Reproduce
Expected behavior
The container should not be restarted as it was not alive for ≥ 10 seconds.
docker version
docker info
Additional Info
No response