Docker Community Forums

Share and learn in the Docker community.

Get number of container restarts in the last 24 hours

Hello everyone

I have question about Docker container restart events.
I want to check: how many times some container died and was started again in the last 24 hours?
I know there is RestartCount in docker inspect but it’s number from starting of the container. I can’t check this way number of restarts in the last 24 hours.
There is also docker events --filter event=die --since=24h --until=1s
It’s fine if there is only one container running, but we have over 20 containers running at once on one machine and docker events is showing events from only last 4 minutes… I saw docs mention that docker events show only last 1000 events but on our machines it never go over 256 last events.

Does anyone have any other ideas on how to get number of die events in the last 24h?

Docker version 19.03.7, build 7141c199a2
docker-compose version 1.23.2, build 1110ad01