github.com/uriddle/docker@v0.0.0-20210926094723-4072e6aeb013/man/docker-events.1.md (about)

     1  % DOCKER(1) Docker User Manuals
     2  % Docker Community
     3  % JUNE 2014
     4  # NAME
     5  docker-events - Get real time events from the server
     6  
     7  # SYNOPSIS
     8  **docker events**
     9  [**--help**]
    10  [**-f**|**--filter**[=*[]*]]
    11  [**--since**[=*SINCE*]]
    12  [**--until**[=*UNTIL*]]
    13  
    14  
    15  # DESCRIPTION
    16  Get event information from the Docker daemon. Information can include historical
    17  information and real-time information.
    18  
    19  Docker containers will report the following events:
    20  
    21      attach, commit, copy, create, destroy, die, exec_create, exec_start, export, kill, oom, pause, rename, resize, restart, start, stop, top, unpause
    22  
    23  and Docker images will report:
    24  
    25      delete, import, pull, push, tag, untag
    26  
    27  # OPTIONS
    28  **--help**
    29    Print usage statement
    30  
    31  **-f**, **--filter**=[]
    32     Provide filter values (i.e., 'event=stop')
    33  
    34  **--since**=""
    35     Show all events created since timestamp
    36  
    37  **--until**=""
    38     Stream events until this timestamp
    39  
    40  The `--since` and `--until` parameters can be Unix timestamps, date formatted
    41  timestamps, or Go duration strings (e.g. `10m`, `1h30m`) computed
    42  relative to the client machine’s time. If you do not provide the --since option,
    43  the command returns only new and/or live events.  Supported formats for date
    44  formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`,
    45  `2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local
    46  timezone on the client will be used if you do not provide either a `Z` or a
    47  `+-00:00` timezone offset at the end of the timestamp.  When providing Unix
    48  timestamps enter seconds[.nanoseconds], where seconds is the number of seconds
    49  that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap
    50  seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a
    51  fraction of a second no more than nine digits long.
    52  
    53  # EXAMPLES
    54  
    55  ## Listening for Docker events
    56  
    57  After running docker events a container 786d698004576 is started and stopped
    58  (The container name has been shortened in the output below):
    59  
    60      # docker events
    61      2015-01-28T20:21:31.000000000-08:00 59211849bc10: (from whenry/testimage:latest) start
    62      2015-01-28T20:21:31.000000000-08:00 59211849bc10: (from whenry/testimage:latest) die
    63      2015-01-28T20:21:32.000000000-08:00 59211849bc10: (from whenry/testimage:latest) stop
    64  
    65  ## Listening for events since a given date
    66  Again the output container IDs have been shortened for the purposes of this document:
    67  
    68      # docker events --since '2015-01-28'
    69      2015-01-28T20:25:38.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) create
    70      2015-01-28T20:25:38.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) start
    71      2015-01-28T20:25:39.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) create
    72      2015-01-28T20:25:39.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) start
    73      2015-01-28T20:25:40.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) die
    74      2015-01-28T20:25:42.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) stop
    75      2015-01-28T20:25:45.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) start
    76      2015-01-28T20:25:45.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) die
    77      2015-01-28T20:25:46.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) stop
    78  
    79  The following example outputs all events that were generated in the last 3 minutes,
    80  relative to the current time on the client machine:
    81  
    82      # docker events --since '3m'
    83      2015-05-12T11:51:30.999999999Z07:00  4386fb97867d: (from ubuntu-1:14.04) die
    84      2015-05-12T15:52:12.999999999Z07:00  4386fb97867d: (from ubuntu-1:14.04) stop
    85      2015-05-12T15:53:45.999999999Z07:00  7805c1d35632: (from redis:2.8) die
    86      2015-05-12T15:54:03.999999999Z07:00  7805c1d35632: (from redis:2.8) stop
    87  
    88  If you do not provide the --since option, the command returns only new and/or
    89  live events.
    90  
    91  # HISTORY
    92  April 2014, Originally compiled by William Henry (whenry at redhat dot com)
    93  based on docker.com source material and internal work.
    94  June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>
    95  June 2015, updated by Brian Goff <cpuguy83@gmail.com>
    96  October 2015, updated by Mike Brown <mikebrow@gmail.com>