It would be cool to show the health check output somewhere in Docker Desktop. I have been adding health check code to some of my containers and it’s a nice way to keep track of their status. But it requires the command line and jq
:
docker inspect db1 | jq ".[].State.Health"
It would be cool to have this built into the GUI.
As an example, here is a health check for mysql.
test: ["CMD-SHELL", "mysqladmin --defaults-extra-file=/run/secrets/mysql-client status"]
It shows output like this:
{
"Status": "healthy",
"FailingStreak": 0,
"Log": [
{
"Start": "2021-04-08T23:25:23.496021341Z",
"End": "2021-04-08T23:25:23.563766178Z",
"ExitCode": 0,
"Output": "Uptime: 21 Threads: 3 Questions: 417 Slow queries: 0 Opens: 277 Flush tables: 3 Open tables: 194 Queries per second avg: 19.857\n"
},
{
"Start": "2021-04-08T23:25:53.566316031Z",
"End": "2021-04-08T23:25:53.630246338Z",
"ExitCode": 0,
"Output": "Uptime: 51 Threads: 3 Questions: 465 Slow queries: 0 Opens: 285 Flush tables: 3 Open tables: 202 Queries per second avg: 9.117\n"
},
{
"Start": "2021-04-08T23:26:23.63399467Z",
"End": "2021-04-08T23:26:23.692539103Z",
"ExitCode": 0,
"Output": "Uptime: 81 Threads: 3 Questions: 473 Slow queries: 0 Opens: 286 Flush tables: 3 Open tables: 203 Queries per second avg: 5.839\n"
}
]
}