Docker Community Forums

Share and learn in the Docker community.

10 seconds to apply restart policy

Hi all,
is is mentioned here: https://docs.docker.com/config/containers/start-containers-automatically/#restart-policy-details that:
“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.”

  1. Is this “10 seconds” interval hard-coded, or it can be configured (lowered)?

  2. Where is this limitation imposed in the code, because looking here: https://github.com/moby/moby/blob/c85fe2d2242fbd6f9e4ea5cdef75d24945018ede/restartmanager/restartmanager.go#L50 I see no limit of that kind at all

BR,
Drasko