Use docker inspect
is different in swarm
mode and normal
mode if you wnat to use it in swarm
mode:
-
Manager nodes: use this command for services. (but if you want to see healthceck logs of specific container see worker nodes section):
docker inspect --format "{{json .Spec.TaskTemplate.ContainerSpec.Healthcheck }}" hinava_dashboard |jq
-
Worker nodes: you should use complete name of the container that completed with
<tab>
keydocker inspect hinava_filebeat.1.umvobmm9wrjdz1b08y5jibvl2 | grep -B 10 -A 10 "health"
docker inspect --format "{{json .State.Health }}" hinava_dashboard.1.kzudauikpx47dulfxlci4mh7e
If you are not using swarm
,in normal
mode the code is the same as the worker node
:
docker inspect hinava_filebeat.1.umvobmm9wrjdz1b08y5jibvl2 | grep -B 10 -A 10 "health"
docker inspect --format "{{json .State.Health }}" hinava_dashboard.1.kzudauikpx47dulfxlci4mh7e
For more information see here