I fully agree that the docs could be improved. The current docs (of CLI) made me interpret it as a command available on the host.
root@Ubuntu18:~# traefik healthcheck --ping
traefik: command not found
so reading this here eventually enlightened me, so I did
docker exec [container name] traefik healtcheck --ping
what results in
root@Ubuntu18:~# docker exec -it traefik traefik healthcheck --ping
INFO[0000] Configuration loaded from flags.
Bad healthcheck status: 404 Not Found
I found a discussion on this result in Strange healthcheck behaviour but I still don't get it.
I used the -t flag to make the output to look a bit prettier. See docker exec | Docker Documentation for more details on the flags.