The Docker API documentation provides a list of the available events, but does not include much detail on what they mean and when they will occur. Since many of our tools depend on the events API, we’ve put together a chart illustrating the events triggered throughout the lifecycle of a Docker container (as of Docker version 1.5 / API version 1.17):
A few container-related events are not included in this illustration since they are not affected by container state:
- export emitted by
- exec_create emitted by
- exec_start also emitted by
docker execafter exec_create
There are also several events not in this diagram that are related to Docker images rather than containers:
- import emitted by
- pull emitted by
- untag emitted by
- delete emitted by
docker rmi emits an
untag event when removing an image tag name. The
rmi command may also emit
delete events for any image IDs deleted, either by deleting an image by ID directly, or deleting the last tag referring to it.
We encourage more people to take advantage of the Docker events API, and we hope this diagram is useful. The Docker team is considering including this diagram in the documentation.