Docker : inspecter les commandes healthcheck

Boris HUISGEN January 19, 2017

administration docker

L’inspection des évènements Docker permet de détecter les containers dont les fréquences d’exécution des healthchecks est trop aggressive.

Pour détecter l’exécution des commandes healthcheck de vos containers, il convient de filtrer les évènements avec le filtre exec_start :

    $ docker system events --filter event=exec_start
    2017-01-19T14:53:32.979634882+01:00 container exec_start: /bin/sh -c /etc/cont-consul/check || exit 1 fa7c8221a53e2a76e61f290c4008f67ea2548b923cc42a11e9234ee0db4cab54 (com.docker.compose.config-hash=b4b13e5e0066bd757aa944cc01869736eb1d150ac04516e19028d070ef5f502c, com.docker.compose.container-number=1, com.docker.compose.oneoff=False, com.docker.compose.project=dev, com.docker.compose.service=zabbix-agent, com.docker.compose.version=1.9.0, image=registry.foobot.io/foobot/zabbix-agent, name=dev_zabbix-agent_1)
    2017-01-19T14:53:33.985556968+01:00 container exec_start: /bin/sh -c /etc/cont-consul/check || exit 1 a009ecbbb3cdce6da2bdf6ae073b9d323bcc2921eafc82206f7e4719e37a617a (com.docker.compose.config-hash=2e83302dfa763cf4185883bed56a64cd8e9207d3a78f06fd250bc158aafedde6, com.docker.compose.container-number=1, com.docker.compose.oneoff=False, com.docker.compose.project=dev, com.docker.compose.service=rabbitmq, com.docker.compose.version=1.9.0, image=registry.foobot.io/foobot/rabbitmq, name=dev_rabbitmq_1)
    2017-01-19T14:53:35.252389013+01:00 container exec_start: /bin/sh -c /etc/cont-consul/check || exit 1 a7398fd76d95544ac6cd8d02fbacb9608d5fd3443c1afb4fa0b4606dc032476c (com.docker.compose.config-hash=3c3cae569ff98e6a7e91b8e6734bfed22e9c5df90c8bd593539ef4876e2bda25, com.docker.compose.container-number=1, com.docker.compose.oneoff=False, com.docker.compose.project=dev, com.docker.compose.service=mariadb, com.docker.compose.version=1.9.0, image=registry.foobot.io/foobot/mariadb, name=dev_mariadb_1)
    2017-01-19T14:53:39.875116453+01:00 container exec_start: /bin/sh -c /etc/cont-consul/check || exit 1 1f41e9a3b5b63601042dbf5dcd758342e217f0f5d5685d76e9f61b2a2c155a5a (com.docker.compose.config-hash=733b83db2c39e867d08158e3101decdc5e3d70fa0653fea7f44139e29b47d2fa, com.docker.compose.container-number=1, com.docker.compose.oneoff=False, com.docker.compose.project=dev, com.docker.compose.service=dynamodb, com.docker.compose.version=1.9.0, image=registry.foobot.io/foobot/dynamodb, name=dev_dynamodb_1)

See also

Docker : images Alpine Linux avec intégration Consul
Read more
Docker : erreur au build « Failed to create thread: Resource temporarily unavailable (11) »
Read more
Maven : construire une image Docker et y intégrer le JAR du projet
Read more