Show health check in GUI

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"
    }
  ]
}
3 Likes

+1 we can see everything.. even advanced stats etc. but not the health status??

1 Like

Current Docker Desktop has a green circle next to the container name or service name when containers are healthy and it changes its color when containers are not healthy. If you move the mouse pointer over the circle, you can even see the status text.

What? This is not true. The green dot only says whether the Container is “running” (green) or “exited” (grey).
It does NOT separately show the Status of the health check, for example as “yellow” if unhealthy.
I currently have this exact case here.
My container in Docker Desktop is “green” and “Running” but when I run docker ps -a
then it clearly states: Up 19 minutes (unhealthy)

So the Docker Desktop does NOT show the health check status correctly.

The only UI I know of which does this accurately and correctly is “Portainer”.
They will show specifically these different Status for a Container:

  1. Has health check & OK ? → Healthy
  2. Has health check & NOT OK ? → Unhealthy
  3. Has no healtch check & OK → Running
  4. Not Running → Stopped
  5. Starting… Stopping… etc.

Then I remembered wrong. I rarely check containers on the GUI. I will check it later. Until then, if it ever worked, you can report it as a bug on GitHub

If it never worked, you can ask for it in the roadmap

This forum is for the community discussing issues, ideas, but there is no guarantee that someone from Docker will read your messages here.

Update:

I checked and I guess I remembered that DD shows how many containers are running in a compose project, but it is true that there is no shown health status currently. Thank you for pointing it out!