, :
HEALTHCHECK, docker
. - :
HEALTHCHECK --interval=5m --timeout=3s \
CMD curl -f http://localhost/ || exit 1
:
docker inspect --format='{{json .State.Health}}' <container_id>
docker ps STATUS:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
225426fc7c93 ubuntu "tail -f /dev/null" 5 seconds ago Up 4 seconds (healthy)
API :
curl --unix-socket /var/run/docker.sock http:/v1.24/containers/json
PS: You can set the health check time to docker run(without modifying the Docker file). Docs
source
share