The docker docs say what a HEALTHCHECK
instruction is and how to check the health of a container. But I am not able to figure out what happens when healthcheck fails. Like will the container be restarted or stoped or any of these two as per user instruction.
Further the example quoted is:
HEALTHCHECK --interval=5m --timeout=3s CMD curl -f http://localhost/ || exit 1
What is the exit 1
about?
exit 1
is to exit with error if the other command (HEALTHCHECK
) didn't succeed. – Pelagia