November 2018
Beginner
230 pages
6h 4m
English
The HEALTHCHECK instruction, which is a fairly new addition to the Dockerfile, is used to define the command to run inside a container to test the container's application health. When a container has a HEALTHCHECK, it gets a special status variable. Initially, that variable will be set to starting. Any time a HEALTHCHECK is performed successfully, the status will be set to healthy. When a HEALTHCHECK is performed and fails, the fail count value will be incremented and then checked against a retries value. If the fail count equals or exceeds the retries value, the status is set to unhealthy. The syntax of the HEALTHCHECK instruction is as follows:
# HEALTHCHECK instruction syntaxHEALTHCHECK [OPTIONS] CMD command ...
Read now
Unlock full access