0a0dd116 |
% DOCKER(1) Docker User Manuals |
b07f1938 |
% Docker Community
% JUNE 2014 |
0a0dd116 |
# NAME
docker-events - Get real time events from the server
|
b07f1938 |
# SYNOPSIS
**docker events** |
a2b529ea |
[**--help**] |
18a2c774 |
[**-f**|**--filter**[=*[]*]] |
b07f1938 |
[**--since**[=*SINCE*]]
[**--until**[=*UNTIL*]]
|
0a0dd116 |
# DESCRIPTION
Get event information from the Docker daemon. Information can include historical
information and real-time information.
|
71e28f9d |
Docker containers will report the following events:
|
d7ca0a48 |
attach, commit, copy, create, destroy, die, exec_create, exec_start, export, kill, oom, pause, rename, resize, restart, start, stop, top, unpause |
71e28f9d |
and Docker images will report:
|
d7ca0a48 |
delete, import, pull, push, tag, untag |
71e28f9d |
|
0a0dd116 |
# OPTIONS |
a2b529ea |
**--help**
Print usage statement
|
18a2c774 |
**-f**, **--filter**=[]
Provide filter values (i.e., 'event=stop')
|
0a0dd116 |
**--since**="" |
b07f1938 |
Show all events created since timestamp
**--until**=""
Stream events until this timestamp |
0a0dd116 |
|
927b334e |
The `--since` and `--until` parameters can be Unix timestamps, date formatted |
430d8ff6 |
timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed
relative to the client machine’s time. If you do not provide the --since option,
the command returns only new and/or live events. Supported formats for date |
927b334e |
formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`, |
430d8ff6 |
`2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local
timezone on the client will be used if you do not provide either a `Z` or a
`+-00:00` timezone offset at the end of the timestamp. When providing Unix
timestamps enter seconds[.nanoseconds], where seconds is the number of seconds
that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap
seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a
fraction of a second no more than nine digits long. |
927b334e |
|
0a0dd116 |
# EXAMPLES
## Listening for Docker events
|
1b2b783b |
After running docker events a container 786d698004576 is started and stopped |
cb92c471 |
(The container name has been shortened in the output below): |
0a0dd116 |
# docker events |
f750f174 |
2015-01-28T20:21:31.000000000-08:00 59211849bc10: (from whenry/testimage:latest) start
2015-01-28T20:21:31.000000000-08:00 59211849bc10: (from whenry/testimage:latest) die
2015-01-28T20:21:32.000000000-08:00 59211849bc10: (from whenry/testimage:latest) stop |
0a0dd116 |
## Listening for events since a given date
Again the output container IDs have been shortened for the purposes of this document:
|
f750f174 |
# docker events --since '2015-01-28'
2015-01-28T20:25:38.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) create
2015-01-28T20:25:38.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) start
2015-01-28T20:25:39.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) create
2015-01-28T20:25:39.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) start
2015-01-28T20:25:40.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) die
2015-01-28T20:25:42.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) stop
2015-01-28T20:25:45.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) start
2015-01-28T20:25:45.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) die
2015-01-28T20:25:46.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) stop |
0a0dd116 |
|
4e3b21f9 |
The following example outputs all events that were generated in the last 3 minutes,
relative to the current time on the client machine:
# docker events --since '3m' |
430d8ff6 |
2015-05-12T11:51:30.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) die
2015-05-12T15:52:12.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) stop |
4e3b21f9 |
2015-05-12T15:53:45.999999999Z07:00 7805c1d35632: (from redis:2.8) die
2015-05-12T15:54:03.999999999Z07:00 7805c1d35632: (from redis:2.8) stop
|
74c12aa4 |
If you do not provide the --since option, the command returns only new and/or
live events.
|
0a0dd116 |
# HISTORY
April 2014, Originally compiled by William Henry (whenry at redhat dot com) |
fa29b1f0 |
based on docker.com source material and internal work. |
b07f1938 |
June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> |
74c12aa4 |
June 2015, updated by Brian Goff <cpuguy83@gmail.com> |
430d8ff6 |
October 2015, updated by Mike Brown <mikebrow@gmail.com> |