I'm trying to find the history of container restarts.
Of course the STATUS
field on a docker ps
will show the current uptime.
However if I have a container with a restart policy such as restart: unless-stopped
and it's gone through several restarts - How can I check that restart/uptime history?
If the docker engine doesn't natively track this - is there a known good method to handle this?
You can view the docker events. E.g. this will show all restart events for the last hour:
For more details on docker events, see: https://docs.docker.com/engine/reference/commandline/events
You can check with following command:
docker system events --filter event=restart
For more information : https://docs.docker.com/engine/reference/commandline/system_events