Docker

Docker events

Launch a container and be notified of related events

The documentation for docker events provides details, but when debugging it may be useful to launch a container and be notified immediately of any related event:

docker run... & docker events --filter 'container=$(docker ps -lq)'

In docker ps -lq, the l stands for last, and the q for quiet. This removes the id of the last container launched, and creates a notification immediately if the container dies or has another event occur.


This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow