I am trying to create a container using Healthchecks.io as the monitor. When the container is successfully created and stays running, the healthcheck never completes. It never pings healthchecks.io for any update. When checking "docker container list --all" after 60 seconds the healthcheck is constantly stating "health: starting" and never changes. The healthchecks.io website is never updated. I verified the image does have curl installed. This was not composed from a YAML but in inline "docker run"
What am I doing incorrectly or what am I doing wrong?
The container is: binhex/arch-delugevpn. I verified curl does exist in the container also.
--health-cmd="/bin/curl -Ss --fail https://hc-ping.com/UUID || exit 1" \
--health-interval=1h \
--health-retries=5 \
--health-timeout=5s \
--health-start-period=60s \
Here is output of "docker inspect" after it is created.
"Healthcheck": {
"Test": [
"CMD-SHELL",
"/bin/curl -Ss --fail https://hc-ping.com/UUID || exit 1"
],
"Interval": 3600000000000,
"Timeout": 5000000000,
"StartPeriod": 60000000000,
"Retries": 12
I have tried manipulating placement of the quotes and types of quotes (None, double, and single) without and without " > /dev/null 2>&1" at end of the healthchecks.io site to possibly prevent problems. wget does not come with the container. The container creates but exits if I just place "curl" and not "/bin/curl" in the string.
I did the following experiment – created a Dockerfile with the following contents:
FROM binhex/arch-delugevpn
HEALTHCHECK --interval=20s --timeout=10s CMD curl https://hc-ping.com/my-uuid-here || exit 1
Built it:
docker build -t my-experiment .
And ran it:
docker run -it --rm my-experiment bash
I now see pings coming in every 20 seconds on Healthchecks.io, the reported curl version is curl/7.88.1-DEV
.
Can you get this example to work?
I then tested it like so, by overriding the healthcheck command with command-line arguments:
docker run -it --rm \
--health-cmd="curl https://hc-ping.com/my-uuid-here || exit 1" \
--health-interval=20s \
--health-timeout=10s \
binhex/arch-delugevpn bash
This also worked, I'm seeing incoming pings every 20 seconds.