What does the "(healthy)" string in STATUS column stands for?
user@user:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
X X X X Up 20 hours X X
X X X X Up 21 hours (healthy) X X
In Morse Code, “SOS” is a signal sequence of three dits, three dats, and another three dits spelling “S-O-S”. The expression “Save Our Ship” was probably coined by sailors to signal for help from a vessel in distress.
The acronyms stand for:HSE: health, safety and environment. HSQE: Health, safety, quality and environment. HSEQ: Health, safety, environment and quality. HSSE: health, safety, security and environment.
SOS, when it was first agreed upon by the International Radio Telegraphic Convention in 1906, was merely a distinctive Morse code sequence and was initially not an abbreviation. Later in popular usage it became associated with mnemonic phrases such as "Save Our Souls" and "Save Our Ship".
That's the result of the HEALTHCHECK
instruction. That instruciton runs a command inside the container every 30 seconds. If the command succeeds, the container is marked healthy. If it fails too many times, it's marked unhealthy.
You can set the interval, timeout, number of retries and start delay.
The following, for example, will check that your container responds to HTTP every 5 minutes with a timeout of 3 seconds.
HEALTHCHECK --interval=5m --timeout=3s \
CMD curl -f http://localhost/ || exit 1
You get a health_status
event when the health status changes. You can follow those and others with docker events
.
https://ryaneschinger.com/blog/using-docker-native-health-checks/
Normally it's something you launch with, to enable swarm or other services to check on the health of the container.
IE:
$ docker run --rm -it \
--name=elasticsearch \
--health-cmd="curl --silent --fail localhost:9200/_cluster/health || exit 1" \
--health-interval=5s \
--health-retries=12 \
--health-timeout=2s \
elasticsearch
see the health checks enabled at runtime?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With