diff --git a/docs/reference/commandline/attach.md b/docs/reference/commandline/container_attach.md similarity index 100% rename from docs/reference/commandline/attach.md rename to docs/reference/commandline/container_attach.md diff --git a/docs/reference/commandline/commit.md b/docs/reference/commandline/container_commit.md similarity index 100% rename from docs/reference/commandline/commit.md rename to docs/reference/commandline/container_commit.md diff --git a/docs/reference/commandline/cp.md b/docs/reference/commandline/container_cp.md similarity index 100% rename from docs/reference/commandline/cp.md rename to docs/reference/commandline/container_cp.md diff --git a/docs/reference/commandline/create.md b/docs/reference/commandline/container_create.md similarity index 100% rename from docs/reference/commandline/create.md rename to docs/reference/commandline/container_create.md diff --git a/docs/reference/commandline/diff.md b/docs/reference/commandline/container_diff.md similarity index 100% rename from docs/reference/commandline/diff.md rename to docs/reference/commandline/container_diff.md diff --git a/docs/reference/commandline/exec.md b/docs/reference/commandline/container_exec.md similarity index 100% rename from docs/reference/commandline/exec.md rename to docs/reference/commandline/container_exec.md diff --git a/docs/reference/commandline/export.md b/docs/reference/commandline/container_export.md similarity index 100% rename from docs/reference/commandline/export.md rename to docs/reference/commandline/container_export.md diff --git a/docs/reference/commandline/kill.md b/docs/reference/commandline/container_kill.md similarity index 100% rename from docs/reference/commandline/kill.md rename to docs/reference/commandline/container_kill.md diff --git a/docs/reference/commandline/logs.md b/docs/reference/commandline/container_logs.md similarity index 100% rename from docs/reference/commandline/logs.md rename to docs/reference/commandline/container_logs.md diff --git a/docs/reference/commandline/pause.md b/docs/reference/commandline/container_pause.md similarity index 100% rename from docs/reference/commandline/pause.md rename to docs/reference/commandline/container_pause.md diff --git a/docs/reference/commandline/port.md b/docs/reference/commandline/container_port.md similarity index 100% rename from docs/reference/commandline/port.md rename to docs/reference/commandline/container_port.md diff --git a/docs/reference/commandline/ps.md b/docs/reference/commandline/container_ps.md similarity index 100% rename from docs/reference/commandline/ps.md rename to docs/reference/commandline/container_ps.md diff --git a/docs/reference/commandline/rename.md b/docs/reference/commandline/container_rename.md similarity index 100% rename from docs/reference/commandline/rename.md rename to docs/reference/commandline/container_rename.md diff --git a/docs/reference/commandline/restart.md b/docs/reference/commandline/container_restart.md similarity index 100% rename from docs/reference/commandline/restart.md rename to docs/reference/commandline/container_restart.md diff --git a/docs/reference/commandline/rm.md b/docs/reference/commandline/container_rm.md similarity index 100% rename from docs/reference/commandline/rm.md rename to docs/reference/commandline/container_rm.md diff --git a/docs/reference/commandline/run.md b/docs/reference/commandline/container_run.md similarity index 100% rename from docs/reference/commandline/run.md rename to docs/reference/commandline/container_run.md diff --git a/docs/reference/commandline/start.md b/docs/reference/commandline/container_start.md similarity index 100% rename from docs/reference/commandline/start.md rename to docs/reference/commandline/container_start.md diff --git a/docs/reference/commandline/stats.md b/docs/reference/commandline/container_stats.md similarity index 100% rename from docs/reference/commandline/stats.md rename to docs/reference/commandline/container_stats.md diff --git a/docs/reference/commandline/stop.md b/docs/reference/commandline/container_stop.md similarity index 100% rename from docs/reference/commandline/stop.md rename to docs/reference/commandline/container_stop.md diff --git a/docs/reference/commandline/top.md b/docs/reference/commandline/container_top.md similarity index 100% rename from docs/reference/commandline/top.md rename to docs/reference/commandline/container_top.md diff --git a/docs/reference/commandline/unpause.md b/docs/reference/commandline/container_unpause.md similarity index 100% rename from docs/reference/commandline/unpause.md rename to docs/reference/commandline/container_unpause.md diff --git a/docs/reference/commandline/update.md b/docs/reference/commandline/container_update.md similarity index 100% rename from docs/reference/commandline/update.md rename to docs/reference/commandline/container_update.md diff --git a/docs/reference/commandline/wait.md b/docs/reference/commandline/container_wait.md similarity index 100% rename from docs/reference/commandline/wait.md rename to docs/reference/commandline/container_wait.md diff --git a/docs/reference/commandline/events.md b/docs/reference/commandline/events.md deleted file mode 100644 index d4ccec316314..000000000000 --- a/docs/reference/commandline/events.md +++ /dev/null @@ -1,412 +0,0 @@ ---- -title: "events" -description: "The events command description and usage" -keywords: "events, container, report" ---- - -# events - -```markdown -Usage: docker events [OPTIONS] - -Get real time events from the server - -Options: - -f, --filter value Filter output based on conditions provided (default []) - --format string Format the output using the given Go template - --help Print usage - --since string Show all events created since timestamp - --until string Stream events until this timestamp -``` - -## Description - -Use `docker events` to get real-time events from the server. These events differ -per Docker object type. Different event types have different scopes. Local -scoped events are only seen on the node they take place on, and swarm scoped -events are seen on all managers. - -Only the last 1000 log events are returned. You can use filters to further limit -the number of events returned. - -### Object types - -#### Containers - -Docker containers report the following events: - -- `attach` -- `commit` -- `copy` -- `create` -- `destroy` -- `detach` -- `die` -- `exec_create` -- `exec_detach` -- `exec_die` -- `exec_start` -- `export` -- `health_status` -- `kill` -- `oom` -- `pause` -- `rename` -- `resize` -- `restart` -- `start` -- `stop` -- `top` -- `unpause` -- `update` - -#### Images - -Docker images report the following events: - -- `delete` -- `import` -- `load` -- `pull` -- `push` -- `save` -- `tag` -- `untag` - -#### Plugins - -Docker plugins report the following events: - -- `enable` -- `disable` -- `install` -- `remove` - -#### Volumes - -Docker volumes report the following events: - -- `create` -- `destroy` -- `mount` -- `unmount` - -#### Networks - -Docker networks report the following events: - -- `create` -- `connect` -- `destroy` -- `disconnect` -- `remove` - -#### Daemons - -Docker daemons report the following events: - -- `reload` - -#### Services - -Docker services report the following events: - -- `create` -- `remove` -- `update` - -#### Nodes - -Docker nodes report the following events: - -- `create` -- `remove` -- `update` - -#### Secrets - -Docker secrets report the following events: - -- `create` -- `remove` -- `update` - -#### Configs - -Docker configs report the following events: - -- `create` -- `remove` -- `update` - -### Limiting, filtering, and formatting the output - -#### Limit events by time - -The `--since` and `--until` parameters can be Unix timestamps, date formatted -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 -formatted time stamps include RFC3339Nano, RFC3339, `2006-01-02T15:04:05`, -`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. - -Only the last 1000 log events are returned. You can use filters to further limit -the number of events returned. - -#### Filtering - -The filtering flag (`-f` or `--filter`) format is of "key=value". If you would -like to use multiple filters, pass multiple flags (e.g., -`--filter "foo=bar" --filter "bif=baz"`) - -Using the same filter multiple times will be handled as a *OR*; for example -`--filter container=588a23dac085 --filter container=a8f7720b8c22` will display -events for container 588a23dac085 *OR* container a8f7720b8c22 - -Using multiple filters will be handled as a *AND*; for example -`--filter container=588a23dac085 --filter event=start` will display events for -container container 588a23dac085 *AND* the event type is *start* - -The currently supported filters are: - -* config (`config=`) -* container (`container=`) -* daemon (`daemon=`) -* event (`event=`) -* image (`image=`) -* label (`label=` or `label==`) -* network (`network=`) -* node (`node=`) -* plugin (`plugin=`) -* scope (`scope=`) -* secret (`secret=`) -* service (`service=`) -* type (`type=`) -* volume (`volume=`) - -#### Format - -If a format (`--format`) is specified, the given template will be executed -instead of the default -format. Go's [text/template](http://golang.org/pkg/text/template/) package -describes all the details of the format. - -If a format is set to `{{json .}}`, the events are streamed as valid JSON -Lines. For information about JSON Lines, please refer to http://jsonlines.org/. - -## Examples - -### Basic example - -You'll need two shells for this example. - -**Shell 1: Listening for events:** - -```bash -$ docker events -``` - -**Shell 2: Start and Stop containers:** - -```bash -$ docker create --name test alpine:latest top -$ docker start test -$ docker stop test -``` - -**Shell 1: (Again .. now showing events):** - -```console -2017-01-05T00:35:58.859401177+08:00 container create 0fdb48addc82871eb34eb23a847cfd033dedd1a0a37bef2e6d9eb3870fc7ff37 (image=alpine:latest, name=test) -2017-01-05T00:36:04.703631903+08:00 network connect e2e1f5ceda09d4300f3a846f0acfaa9a8bb0d89e775eb744c5acecd60e0529e2 (container=0fdb...ff37, name=bridge, type=bridge) -2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test) -2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15) -2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test) -2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge) -2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test) -``` - -To exit the `docker events` command, use `CTRL+C`. - -### Filter events by time - -You can filter the output by an absolute timestamp or relative time on the host -machine, using the following different time syntaxes: - -```bash -$ docker events --since 1483283804 -2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local) -2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test) -2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge) -2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test) -2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15) -2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test) -2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge) -2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test) - -$ docker events --since '2017-01-05' -2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local) -2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test) -2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge) -2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test) -2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15) -2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test) -2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge) -2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test) - -$ docker events --since '2013-09-03T15:49:29' -2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local) -2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test) -2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge) -2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test) -2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15) -2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test) -2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge) -2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test) - -$ docker events --since '10m' -2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local) -2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test) -2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge) -2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test) -2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15) -2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test) -2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge) -2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test) - -$ docker events --since '2017-01-05T00:35:30' --until '2017-01-05T00:36:05' -2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local) -2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test) -2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge) -2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test) -``` - -### Filter events by criteria - -The following commands show several different ways to filter the `docker event` -output. - -```bash -$ docker events --filter 'event=stop' - -2017-01-05T00:40:22.880175420+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test) -2017-01-05T00:41:17.888104182+08:00 container stop 2a8f...4e78 (image=alpine, name=kickass_brattain) - -$ docker events --filter 'image=alpine' - -2017-01-05T00:41:55.784240236+08:00 container create d9cd...4d70 (image=alpine, name=happy_meitner) -2017-01-05T00:41:55.913156783+08:00 container start d9cd...4d70 (image=alpine, name=happy_meitner) -2017-01-05T00:42:01.106875249+08:00 container kill d9cd...4d70 (image=alpine, name=happy_meitner, signal=15) -2017-01-05T00:42:11.111934041+08:00 container kill d9cd...4d70 (image=alpine, name=happy_meitner, signal=9) -2017-01-05T00:42:11.119578204+08:00 container die d9cd...4d70 (exitCode=137, image=alpine, name=happy_meitner) -2017-01-05T00:42:11.173276611+08:00 container stop d9cd...4d70 (image=alpine, name=happy_meitner) - -$ docker events --filter 'container=test' - -2017-01-05T00:43:00.139719934+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test) -2017-01-05T00:43:09.259951086+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15) -2017-01-05T00:43:09.270102715+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test) -2017-01-05T00:43:09.312556440+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test) - -$ docker events --filter 'container=test' --filter 'container=d9cdb1525ea8' - -2017-01-05T00:44:11.517071981+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test) -2017-01-05T00:44:17.685870901+08:00 container start d9cd...4d70 (image=alpine, name=happy_meitner) -2017-01-05T00:44:29.757658470+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=9) -2017-01-05T00:44:29.767718510+08:00 container die 0fdb...ff37 (exitCode=137, image=alpine:latest, name=test) -2017-01-05T00:44:29.815798344+08:00 container destroy 0fdb...ff37 (image=alpine:latest, name=test) - -$ docker events --filter 'container=test' --filter 'event=stop' - -2017-01-05T00:46:13.664099505+08:00 container stop a9d1...e130 (image=alpine, name=test) - -$ docker events --filter 'type=volume' - -2015-12-23T21:05:28.136212689Z volume create test-event-volume-local (driver=local) -2015-12-23T21:05:28.383462717Z volume mount test-event-volume-local (read/write=true, container=562f...5025, destination=/foo, driver=local, propagation=rprivate) -2015-12-23T21:05:28.650314265Z volume unmount test-event-volume-local (container=562f...5025, driver=local) -2015-12-23T21:05:28.716218405Z volume destroy test-event-volume-local (driver=local) - -$ docker events --filter 'type=network' - -2015-12-23T21:38:24.705709133Z network create 8b11...2c5b (name=test-event-network-local, type=bridge) -2015-12-23T21:38:25.119625123Z network connect 8b11...2c5b (name=test-event-network-local, container=b4be...c54e, type=bridge) - -$ docker events --filter 'container=container_1' --filter 'container=container_2' - -2014-09-03T15:49:29.999999999Z07:00 container die 4386fb97867d (image=ubuntu-1:14.04) -2014-05-10T17:42:14.999999999Z07:00 container stop 4386fb97867d (image=ubuntu-1:14.04) -2014-05-10T17:42:14.999999999Z07:00 container die 7805c1d35632 (imager=redis:2.8) -2014-09-03T15:49:29.999999999Z07:00 container stop 7805c1d35632 (image=redis:2.8) - -$ docker events --filter 'type=volume' - -2015-12-23T21:05:28.136212689Z volume create test-event-volume-local (driver=local) -2015-12-23T21:05:28.383462717Z volume mount test-event-volume-local (read/write=true, container=562fe10671e9273da25eed36cdce26159085ac7ee6707105fd534866340a5025, destination=/foo, driver=local, propagation=rprivate) -2015-12-23T21:05:28.650314265Z volume unmount test-event-volume-local (container=562fe10671e9273da25eed36cdce26159085ac7ee6707105fd534866340a5025, driver=local) -2015-12-23T21:05:28.716218405Z volume destroy test-event-volume-local (driver=local) - -$ docker events --filter 'type=network' - -2015-12-23T21:38:24.705709133Z network create 8b111217944ba0ba844a65b13efcd57dc494932ee2527577758f939315ba2c5b (name=test-event-network-local, type=bridge) -2015-12-23T21:38:25.119625123Z network connect 8b111217944ba0ba844a65b13efcd57dc494932ee2527577758f939315ba2c5b (name=test-event-network-local, container=b4be644031a3d90b400f88ab3d4bdf4dc23adb250e696b6328b85441abe2c54e, type=bridge) - -$ docker events --filter 'type=plugin' - -2016-07-25T17:30:14.825557616Z plugin pull ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/sample-volume-plugin:latest) -2016-07-25T17:30:14.888127370Z plugin enable ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/sample-volume-plugin:latest) - -$ docker events -f type=service - -2017-07-12T06:34:07.999446625Z service create wj64st89fzgchxnhiqpn8p4oj (name=reverent_albattani) -2017-07-12T06:34:21.405496207Z service remove wj64st89fzgchxnhiqpn8p4oj (name=reverent_albattani) - -$ docker events -f type=node - -2017-07-12T06:21:51.951586759Z node update 3xyz5ttp1a253q74z1thwywk9 (name=ip-172-31-23-42, state.new=ready, state.old=unknown) - -$ docker events -f type=secret - -2017-07-12T06:32:13.915704367Z secret create s8o6tmlnndrgzbmdilyy5ymju (name=new_secret) -2017-07-12T06:32:37.052647783Z secret remove s8o6tmlnndrgzbmdilyy5ymju (name=new_secret) - -$ docker events -f type=config -2017-07-12T06:44:13.349037127Z config create u96zlvzdfsyb9sg4mhyxfh3rl (name=abc) -2017-07-12T06:44:36.327694184Z config remove u96zlvzdfsyb9sg4mhyxfh3rl (name=abc) - -$ docker events --filter 'scope=swarm' - -2017-07-10T07:46:50.250024503Z service create m8qcxu8081woyof7w3jaax6gk (name=affectionate_wilson) -2017-07-10T07:47:31.093797134Z secret create 6g5pufzsv438p9tbvl9j94od4 (name=new_secret) -``` - -### Format the output - -```bash -$ docker events --filter 'type=container' --format 'Type={{.Type}} Status={{.Status}} ID={{.ID}}' - -Type=container Status=create ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 -Type=container Status=attach ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 -Type=container Status=start ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 -Type=container Status=resize ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 -Type=container Status=die ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 -Type=container Status=destroy ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 -``` - -#### Format as JSON - -```bash -$ docker events --format '{{json .}}' - -{"status":"create","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f4.. -{"status":"attach","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f4.. -{"Type":"network","Action":"connect","Actor":{"ID":"1b50a5bf755f6021dfa78e.. -{"status":"start","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f42.. -{"status":"resize","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f4.. -``` diff --git a/docs/reference/commandline/build.md b/docs/reference/commandline/image_build.md similarity index 100% rename from docs/reference/commandline/build.md rename to docs/reference/commandline/image_build.md diff --git a/docs/reference/commandline/history.md b/docs/reference/commandline/image_history.md similarity index 100% rename from docs/reference/commandline/history.md rename to docs/reference/commandline/image_history.md diff --git a/docs/reference/commandline/import.md b/docs/reference/commandline/image_import.md similarity index 100% rename from docs/reference/commandline/import.md rename to docs/reference/commandline/image_import.md diff --git a/docs/reference/commandline/load.md b/docs/reference/commandline/image_load.md similarity index 100% rename from docs/reference/commandline/load.md rename to docs/reference/commandline/image_load.md diff --git a/docs/reference/commandline/images.md b/docs/reference/commandline/image_ls.md similarity index 100% rename from docs/reference/commandline/images.md rename to docs/reference/commandline/image_ls.md diff --git a/docs/reference/commandline/pull.md b/docs/reference/commandline/image_pull.md similarity index 100% rename from docs/reference/commandline/pull.md rename to docs/reference/commandline/image_pull.md diff --git a/docs/reference/commandline/push.md b/docs/reference/commandline/image_push.md similarity index 100% rename from docs/reference/commandline/push.md rename to docs/reference/commandline/image_push.md diff --git a/docs/reference/commandline/rmi.md b/docs/reference/commandline/image_rm.md similarity index 100% rename from docs/reference/commandline/rmi.md rename to docs/reference/commandline/image_rm.md diff --git a/docs/reference/commandline/save.md b/docs/reference/commandline/image_save.md similarity index 100% rename from docs/reference/commandline/save.md rename to docs/reference/commandline/image_save.md diff --git a/docs/reference/commandline/tag.md b/docs/reference/commandline/image_tag.md similarity index 100% rename from docs/reference/commandline/tag.md rename to docs/reference/commandline/image_tag.md diff --git a/docs/reference/commandline/index.md b/docs/reference/commandline/index.md index 1d4e8c72c0d4..e8b4130e64b6 100644 --- a/docs/reference/commandline/index.md +++ b/docs/reference/commandline/index.md @@ -20,169 +20,169 @@ read the [`dockerd`](dockerd.md) reference page. ### Docker management commands -| Command | Description | -|:--------|:-------------------------------------------------------------------| -| [dockerd](dockerd.md) | Launch the Docker daemon | -| [info](info.md) | Display system-wide information | -| [inspect](inspect.md)| Return low-level information on a container or image | -| [version](version.md) | Show the Docker version information | +| Command | Description | +|:----------------------------------|:------------------------------------------------------| +| [dockerd](dockerd.md) | Launch the Docker daemon | +| [info](system_info.md) | Display system-wide information | +| [inspect](inspect.md) | Return low-level information on a container or image | +| [version](version.md) | Show the Docker version information | +| [system events](system_events.md) | Get real time events from the server | ### Image commands -| Command | Description | -|:--------|:-------------------------------------------------------------------| -| [build](build.md) | Build an image from a Dockerfile | -| [commit](commit.md) | Create a new image from a container's changes | -| [history](history.md) | Show the history of an image | -| [images](images.md) | List images | -| [import](import.md) | Import the contents from a tarball to create a filesystem image | -| [load](load.md) | Load an image from a tar archive or STDIN | -| [image prune](image_prune.md) | Remove unused images | -| [rmi](rmi.md) | Remove one or more images | -| [save](save.md) | Save images to a tar archive | -| [tag](tag.md) | Tag an image into a repository | +| Command | Description | +|:--------------------------------------|:------------------------------------------------------------------| +| [image build](image_build.md) | Build an image from a Dockerfile | +| [image history](image_history.md) | Show the history of an image | +| [image ls](image_ls.md) | List images | +| [image import](image_import.md) | Import the contents from a tarball to create a filesystem image | +| [image load](image_load.md) | Load an image from a tar archive or STDIN | +| [image prune](image_prune.md) | Remove unused images | +| [image pull](image_pull.md) | Pull an image or a repository from a Docker registry | +| [image push](image_push.md) | Push an image or a repository to a Docker registry | +| [image rm](image_rm.md) | Remove one or more images | +| [image save](image_save.md) | Save images to a tar archive | +| [image tag](image_tag.md) | Tag an image into a repository | ### Container commands -| Command | Description | -|:--------|:-------------------------------------------------------------------| -| [attach](attach.md) | Attach to a running container | -| [container prune](container_prune.md) | Remove all stopped containers | -| [cp](cp.md) | Copy files/folders from a container to a HOSTDIR or to STDOUT | -| [create](create.md) | Create a new container | -| [diff](diff.md) | Inspect changes on a container's filesystem | -| [events](events.md) | Get real time events from the server | -| [exec](exec.md) | Run a command in a running container | -| [export](export.md) | Export a container's filesystem as a tar archive | -| [kill](kill.md) | Kill a running container | -| [logs](logs.md) | Fetch the logs of a container | -| [pause](pause.md) | Pause all processes within a container | -| [port](port.md) | List port mappings or a specific mapping for the container | -| [ps](ps.md) | List containers | -| [rename](rename.md) | Rename a container | -| [restart](restart.md) | Restart a running container | -| [rm](rm.md) | Remove one or more containers | -| [run](run.md) | Run a command in a new container | -| [start](start.md) | Start one or more stopped containers | -| [stats](stats.md) | Display a live stream of container(s) resource usage statistics | -| [stop](stop.md) | Stop a running container | -| [top](top.md) | Display the running processes of a container | -| [unpause](unpause.md) | Unpause all processes within a container | -| [update](update.md) | Update configuration of one or more containers | -| [wait](wait.md) | Block until a container stops, then print its exit code | +| Command | Description | +|:------------------------------------------|:------------------------------------------------------------------| +| [container attach](container_attach.md) | Attach to a running container | +| [container prune](container_prune.md) | Remove all stopped containers | +| [container commit](container_commit.md) | Create a new image from a container's changes | +| [container cp](container_cp.md) | Copy files/folders from a container to a HOSTDIR or to STDOUT | +| [container create](container_create.md) | Create a new container | +| [container diff](container_diff.md) | Inspect changes on a container's filesystem | +| [container exec](container_exec.md) | Run a command in a running container | +| [container export](container_export.md) | Export a container's filesystem as a tar archive | +| [container kill](container_kill.md) | Kill a running container | +| [container logs](container_logs.md) | Fetch the logs of a container | +| [container pause](container_pause.md) | Pause all processes within a container | +| [container port](container_port.md) | List port mappings or a specific mapping for the container | +| [container ps](container_ps.md) | List containers | +| [container rename](container_rename.md) | Rename a container | +| [container restart](container_restart.md) | Restart a running container | +| [container rm](container_rm.md) | Remove one or more containers | +| [container run](container_run.md) | Run a command in a new container | +| [container start](container_start.md) | Start one or more stopped containers | +| [container stats](container_stats.md) | Display a live stream of container(s) resource usage statistics | +| [container stop](container_stop.md) | Stop a running container | +| [container top](container_top.md) | Display the running processes of a container | +| [container unpause](container_unpause.md) | Unpause all processes within a container | +| [container update](container_update.md) | Update configuration of one or more containers | +| [container wait](container_wait.md) | Block until a container stops, then print its exit code | ### Hub and registry commands -| Command | Description | -|:--------|:-------------------------------------------------------------------| -| [login](login.md) | Register or log in to a Docker registry | +| Command | Description | +|:--------------------|:-------------------------------------------------------| +| [login](login.md) | Register or log in to a Docker registry | | [logout](logout.md) | Log out from a Docker registry | -| [pull](pull.md) | Pull an image or a repository from a Docker registry | -| [push](push.md) | Push an image or a repository to a Docker registry | | [search](search.md) | Search the Docker Hub for images | ### Network and connectivity commands -| Command | Description | -|:--------|:-------------------------------------------------------------------| -| [network connect](network_connect.md) | Connect a container to a network | -| [network create](network_create.md) | Create a new network | -| [network disconnect](network_disconnect.md) | Disconnect a container from a network | -| [network inspect](network_inspect.md) | Display information about a network | -| [network ls](network_ls.md) | Lists all the networks the Engine `daemon` knows about | -| [network prune](network_prune.md) | Remove all unused networks | -| [network rm](network_rm.md) | Removes one or more networks | +| Command | Description | +|:----------------------------------------------|:--------------------------------------| +| [network connect](network_connect.md) | Connect a container to a network | +| [network create](network_create.md) | Create a new network | +| [network disconnect](network_disconnect.md) | Disconnect a container from a network | +| [network inspect](network_inspect.md) | Display information about a network | +| [network ls](network_ls.md) | Lists all networks | +| [network prune](network_prune.md) | Remove all unused networks | +| [network rm](network_rm.md) | Removes one or more networks | ### Shared data volume commands -| Command | Description | -|:--------|:-------------------------------------------------------------------| -| [volume create](volume_create.md) | Creates a new volume where containers can consume and store data | -| [volume inspect](volume_inspect.md) | Display information about a volume | -| [volume ls](volume_ls.md) | Lists all the volumes Docker knows about | -| [volume prune](volume_prune.md) | Remove all unused local volumes | -| [volume rm](volume_rm.md) | Remove one or more volumes | +| Command | Description | +|:--------------------------------------|:------------------------------------------------------| +| [volume create](volume_create.md) | Creates a new volume where containers can store data | +| [volume inspect](volume_inspect.md) | Display information about a volume | +| [volume ls](volume_ls.md) | Lists all the volumes Docker knows about | +| [volume prune](volume_prune.md) | Remove all unused local volumes | +| [volume rm](volume_rm.md) | Remove one or more volumes | ### Swarm node commands -| Command | Description | -|:--------|:-------------------------------------------------------------------| -| [node demote](node_demote.md) | Demotes an existing manager so that it is no longer a manager | -| [node inspect](node_inspect.md) | Inspect a node in the swarm | -| [node ls](node_ls.md) | List nodes in the swarm | -| [node promote](node_promote.md) | Promote a node that is pending a promotion to manager | -| [node ps](node_ps.md) | List tasks running on one or more nodes | -| [node rm](node_rm.md) | Remove one or more nodes from the swarm | -| [node update](node_update.md) | Update attributes for a node | +| Command | Description | +|:--------------------------------|:--------------------------------------------------------------| +| [node demote](node_demote.md) | Demotes an existing manager so that it is no longer a manager | +| [node inspect](node_inspect.md) | Inspect a node in the swarm | +| [node ls](node_ls.md) | List nodes in the swarm | +| [node promote](node_promote.md) | Promote a node that is pending a promotion to manager | +| [node ps](node_ps.md) | List tasks running on one or more nodes | +| [node rm](node_rm.md) | Remove one or more nodes from the swarm | +| [node update](node_update.md) | Update attributes for a node | ### Swarm management commands -| Command | Description | -|:--------|:-------------------------------------------------------------------| -| [swarm init](swarm_init.md) | Initialize a swarm | -| [swarm join](swarm_join.md) | Join a swarm as a manager node or worker node | -| [swarm leave](swarm_leave.md) | Remove the current node from the swarm | -| [swarm join-token](swarm_join_token.md) | Display or rotate join tokens | -| [swarm unlock](swarm_unlock.md) | Unlock swarm | -| [swarm unlock-key](swarm_unlock_key.md) | Manage the unlock key | -| [swarm update](swarm_update.md) | Update attributes of a swarm | +| Command | Description | +|:----------------------------------------|:-----------------------------------------------| +| [swarm init](swarm_init.md) | Initialize a swarm | +| [swarm join](swarm_join.md) | Join a swarm as a manager node or worker node | +| [swarm leave](swarm_leave.md) | Remove the current node from the swarm | +| [swarm join-token](swarm_join_token.md) | Display or rotate join tokens | +| [swarm unlock](swarm_unlock.md) | Unlock swarm | +| [swarm unlock-key](swarm_unlock_key.md) | Manage the unlock key | +| [swarm update](swarm_update.md) | Update attributes of a swarm | ### Swarm service commands -| Command | Description | -|:--------|:-------------------------------------------------------------------| -| [service create](service_create.md) | Create a new service | -| [service inspect](service_inspect.md) | Inspect a service | -| [service logs](service_logs.md) | Fetch the logs of a service or task | -| [service ls](service_ls.md) | List services in the swarm | -| [service ps](service_ps.md) | List the tasks of a service | -| [service rm](service_rm.md) | Remove a service from the swarm | -| [service scale](service_scale.md) | Set the number of replicas for the desired state of the service | -| [service update](service_update.md) | Update the attributes of a service | +| Command | Description | +|:--------------------------------------|:----------------------------------------------------------------| +| [service create](service_create.md) | Create a new service | +| [service inspect](service_inspect.md) | Inspect a service | +| [service logs](service_logs.md) | Fetch the logs of a service or task | +| [service ls](service_ls.md) | List services in the swarm | +| [service ps](service_ps.md) | List the tasks of a service | +| [service rm](service_rm.md) | Remove a service from the swarm | +| [service scale](service_scale.md) | Set the number of replicas for the desired state of the service | +| [service update](service_update.md) | Update the attributes of a service | ### Swarm secret commands -| Command | Description | -|:--------|:-------------------------------------------------------------------| -| [secret create](secret_create.md) | Create a secret from a file or STDIN as content | -| [secret inspect](service_inspect.md) | Inspect the specified secret | -| [secret ls](secret_ls.md) | List secrets in the swarm | -| [secret rm](secret_rm.md) | Remove the specified secrets from the swarm | +| Command | Description | +|:--------------------------------------|:--------------------------------------------------| +| [secret create](secret_create.md) | Create a secret from a file or STDIN as content | +| [secret inspect](service_inspect.md) | Inspect the specified secret | +| [secret ls](secret_ls.md) | List secrets in the swarm | +| [secret rm](secret_rm.md) | Remove the specified secrets from the swarm | ### Swarm stack commands -| Command | Description | -|:--------|:-------------------------------------------------------------------| -| [stack deploy](stack_deploy.md) | Deploy a new stack or update an existing stack | -| [stack ls](stack_ls.md) | List stacks in the swarm | -| [stack ps](stack_ps.md) | List the tasks in the stack | -| [stack rm](stack_rm.md) | Remove the stack from the swarm | -| [stack services](stack_services.md) | List the services in the stack | +| Command | Description | +|:--------------------------------------|:--------------------------------------------------| +| [stack deploy](stack_deploy.md) | Deploy a new stack or update an existing stack | +| [stack ls](stack_ls.md) | List stacks in the swarm | +| [stack ps](stack_ps.md) | List the tasks in the stack | +| [stack rm](stack_rm.md) | Remove the stack from the swarm | +| [stack services](stack_services.md) | List the services in the stack | ### Plugin commands -| Command | Description | -|:--------|:-------------------------------------------------------------------| -| [plugin create](plugin_create.md) | Create a plugin from a rootfs and configuration | -| [plugin disable](plugin_disable.md) | Disable a plugin | -| [plugin enable](plugin_enable.md) | Enable a plugin | -| [plugin inspect](plugin_inspect.md) | Display detailed information on a plugin | -| [plugin install](plugin_install.md) | Install a plugin | -| [plugin ls](plugin_ls.md) | List plugins | -| [plugin push](plugin_push.md) | Push a plugin to a registry | -| [plugin rm](plugin_rm.md) | Remove a plugin | -| [plugin set](plugin_set.md) | Change settings for a plugin | +| Command | Description | +|:--------------------------------------|:--------------------------------------------------| +| [plugin create](plugin_create.md) | Create a plugin from a rootfs and configuration | +| [plugin disable](plugin_disable.md) | Disable a plugin | +| [plugin enable](plugin_enable.md) | Enable a plugin | +| [plugin inspect](plugin_inspect.md) | Display detailed information on a plugin | +| [plugin install](plugin_install.md) | Install a plugin | +| [plugin ls](plugin_ls.md) | List plugins | +| [plugin push](plugin_push.md) | Push a plugin to a registry | +| [plugin rm](plugin_rm.md) | Remove a plugin | +| [plugin set](plugin_set.md) | Change settings for a plugin | ### Context commands -| Command | Description | -|:--------|:-------------------------------------------------------------------| -| [context create](context_create.md) | Create a context | -| [context export](context_export.md) | Export a context | -| [context import](context_import.md) | Import a context | -| [context ls](context_ls.md) | List contexts | -| [context rm](context_rm.md) | Remove one or more contexts | -| [context update](context_update.md) | Update a context | -| [context use](context_use.md) | Set the current docker context | -| [context inspect](context_inspect.md) | Inspect one or more contexts | +| Command | Description | +|:--------------------------------------|:--------------------------------------------------| +| [context create](context_create.md) | Create a context | +| [context export](context_export.md) | Export a context | +| [context import](context_import.md) | Import a context | +| [context ls](context_ls.md) | List contexts | +| [context rm](context_rm.md) | Remove one or more contexts | +| [context update](context_update.md) | Update a context | +| [context use](context_use.md) | Set the current docker context | +| [context inspect](context_inspect.md) | Inspect one or more contexts | diff --git a/docs/reference/commandline/system_events.md b/docs/reference/commandline/system_events.md index 1f4a04ec2262..d4ccec316314 100644 --- a/docs/reference/commandline/system_events.md +++ b/docs/reference/commandline/system_events.md @@ -1,13 +1,13 @@ --- -title: "system events" -description: "The system events command description and usage" -keywords: "system, events, container, report" +title: "events" +description: "The events command description and usage" +keywords: "events, container, report" --- -# system events +# events ```markdown -Usage: docker system events [OPTIONS] +Usage: docker events [OPTIONS] Get real time events from the server @@ -21,8 +21,13 @@ Options: ## Description -Use `docker system events` to get real-time events from the server. These -events differ per Docker object type. +Use `docker events` to get real-time events from the server. These events differ +per Docker object type. Different event types have different scopes. Local +scoped events are only seen on the node they take place on, and swarm scoped +events are seen on all managers. + +Only the last 1000 log events are returned. You can use filters to further limit +the number of events returned. ### Object types @@ -39,6 +44,7 @@ Docker containers report the following events: - `die` - `exec_create` - `exec_detach` +- `exec_die` - `exec_start` - `export` - `health_status` @@ -71,9 +77,9 @@ Docker images report the following events: Docker plugins report the following events: -- `install` - `enable` - `disable` +- `install` - `remove` #### Volumes @@ -81,9 +87,9 @@ Docker plugins report the following events: Docker volumes report the following events: - `create` +- `destroy` - `mount` - `unmount` -- `destroy` #### Networks @@ -91,8 +97,9 @@ Docker networks report the following events: - `create` - `connect` -- `disconnect` - `destroy` +- `disconnect` +- `remove` #### Daemons @@ -100,6 +107,38 @@ Docker daemons report the following events: - `reload` +#### Services + +Docker services report the following events: + +- `create` +- `remove` +- `update` + +#### Nodes + +Docker nodes report the following events: + +- `create` +- `remove` +- `update` + +#### Secrets + +Docker secrets report the following events: + +- `create` +- `remove` +- `update` + +#### Configs + +Docker configs report the following events: + +- `create` +- `remove` +- `update` + ### Limiting, filtering, and formatting the output #### Limit events by time @@ -117,6 +156,9 @@ 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. +Only the last 1000 log events are returned. You can use filters to further limit +the number of events returned. + #### Filtering The filtering flag (`-f` or `--filter`) format is of "key=value". If you would @@ -133,15 +175,20 @@ container container 588a23dac085 *AND* the event type is *start* The currently supported filters are: +* config (`config=`) * container (`container=`) * daemon (`daemon=`) * event (`event=`) -* image (`image=`) +* image (`image=`) * label (`label=` or `label==`) * network (`network=`) +* node (`node=`) * plugin (`plugin=`) -* type (`type=`) -* volume (`volume=`) +* scope (`scope=`) +* secret (`secret=`) +* service (`service=`) +* type (`type=`) +* volume (`volume=`) #### Format @@ -151,7 +198,7 @@ format. Go's [text/template](http://golang.org/pkg/text/template/) package describes all the details of the format. If a format is set to `{{json .}}`, the events are streamed as valid JSON -Lines. For information about JSON Lines, please refer to http://jsonlines.org/ . +Lines. For information about JSON Lines, please refer to http://jsonlines.org/. ## Examples @@ -162,7 +209,7 @@ You'll need two shells for this example. **Shell 1: Listening for events:** ```bash -$ docker system events +$ docker events ``` **Shell 2: Start and Stop containers:** @@ -185,7 +232,7 @@ $ docker stop test 2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test) ``` -To exit the `docker system events` command, use `CTRL+C`. +To exit the `docker events` command, use `CTRL+C`. ### Filter events by time @@ -193,8 +240,7 @@ You can filter the output by an absolute timestamp or relative time on the host machine, using the following different time syntaxes: ```bash -$ docker system events --since 1483283804 - +$ docker events --since 1483283804 2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local) 2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test) 2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge) @@ -204,8 +250,7 @@ $ docker system events --since 1483283804 2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge) 2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test) -$ docker system events --since '2017-01-05' - +$ docker events --since '2017-01-05' 2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local) 2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test) 2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge) @@ -215,8 +260,7 @@ $ docker system events --since '2017-01-05' 2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge) 2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test) -$ docker system events --since '2013-09-03T15:49:29' - +$ docker events --since '2013-09-03T15:49:29' 2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local) 2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test) 2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge) @@ -226,8 +270,7 @@ $ docker system events --since '2013-09-03T15:49:29' 2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge) 2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test) -$ docker system events --since '10m' - +$ docker events --since '10m' 2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local) 2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test) 2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge) @@ -236,6 +279,12 @@ $ docker system events --since '10m' 2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test) 2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge) 2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test) + +$ docker events --since '2017-01-05T00:35:30' --until '2017-01-05T00:36:05' +2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local) +2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test) +2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge) +2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test) ``` ### Filter events by criteria @@ -244,12 +293,12 @@ The following commands show several different ways to filter the `docker event` output. ```bash -$ docker system events --filter 'event=stop' +$ docker events --filter 'event=stop' 2017-01-05T00:40:22.880175420+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test) 2017-01-05T00:41:17.888104182+08:00 container stop 2a8f...4e78 (image=alpine, name=kickass_brattain) -$ docker system events --filter 'image=alpine' +$ docker events --filter 'image=alpine' 2017-01-05T00:41:55.784240236+08:00 container create d9cd...4d70 (image=alpine, name=happy_meitner) 2017-01-05T00:41:55.913156783+08:00 container start d9cd...4d70 (image=alpine, name=happy_meitner) @@ -258,14 +307,14 @@ $ docker system events --filter 'image=alpine' 2017-01-05T00:42:11.119578204+08:00 container die d9cd...4d70 (exitCode=137, image=alpine, name=happy_meitner) 2017-01-05T00:42:11.173276611+08:00 container stop d9cd...4d70 (image=alpine, name=happy_meitner) -$ docker system events --filter 'container=test' +$ docker events --filter 'container=test' 2017-01-05T00:43:00.139719934+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test) 2017-01-05T00:43:09.259951086+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15) 2017-01-05T00:43:09.270102715+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test) 2017-01-05T00:43:09.312556440+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test) -$ docker system events --filter 'container=test' --filter 'container=d9cdb1525ea8' +$ docker events --filter 'container=test' --filter 'container=d9cdb1525ea8' 2017-01-05T00:44:11.517071981+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test) 2017-01-05T00:44:17.685870901+08:00 container start d9cd...4d70 (image=alpine, name=happy_meitner) @@ -273,51 +322,74 @@ $ docker system events --filter 'container=test' --filter 'container=d9cdb1525ea 2017-01-05T00:44:29.767718510+08:00 container die 0fdb...ff37 (exitCode=137, image=alpine:latest, name=test) 2017-01-05T00:44:29.815798344+08:00 container destroy 0fdb...ff37 (image=alpine:latest, name=test) -$ docker system events --filter 'container=test' --filter 'event=stop' +$ docker events --filter 'container=test' --filter 'event=stop' 2017-01-05T00:46:13.664099505+08:00 container stop a9d1...e130 (image=alpine, name=test) -$ docker system events --filter 'type=volume' +$ docker events --filter 'type=volume' 2015-12-23T21:05:28.136212689Z volume create test-event-volume-local (driver=local) 2015-12-23T21:05:28.383462717Z volume mount test-event-volume-local (read/write=true, container=562f...5025, destination=/foo, driver=local, propagation=rprivate) 2015-12-23T21:05:28.650314265Z volume unmount test-event-volume-local (container=562f...5025, driver=local) 2015-12-23T21:05:28.716218405Z volume destroy test-event-volume-local (driver=local) -$ docker system events --filter 'type=network' +$ docker events --filter 'type=network' 2015-12-23T21:38:24.705709133Z network create 8b11...2c5b (name=test-event-network-local, type=bridge) 2015-12-23T21:38:25.119625123Z network connect 8b11...2c5b (name=test-event-network-local, container=b4be...c54e, type=bridge) -$ docker system events --filter 'container=container_1' --filter 'container=container_2' +$ docker events --filter 'container=container_1' --filter 'container=container_2' 2014-09-03T15:49:29.999999999Z07:00 container die 4386fb97867d (image=ubuntu-1:14.04) 2014-05-10T17:42:14.999999999Z07:00 container stop 4386fb97867d (image=ubuntu-1:14.04) 2014-05-10T17:42:14.999999999Z07:00 container die 7805c1d35632 (imager=redis:2.8) 2014-09-03T15:49:29.999999999Z07:00 container stop 7805c1d35632 (image=redis:2.8) -$ docker system events --filter 'type=volume' +$ docker events --filter 'type=volume' 2015-12-23T21:05:28.136212689Z volume create test-event-volume-local (driver=local) 2015-12-23T21:05:28.383462717Z volume mount test-event-volume-local (read/write=true, container=562fe10671e9273da25eed36cdce26159085ac7ee6707105fd534866340a5025, destination=/foo, driver=local, propagation=rprivate) 2015-12-23T21:05:28.650314265Z volume unmount test-event-volume-local (container=562fe10671e9273da25eed36cdce26159085ac7ee6707105fd534866340a5025, driver=local) 2015-12-23T21:05:28.716218405Z volume destroy test-event-volume-local (driver=local) -$ docker system events --filter 'type=network' +$ docker events --filter 'type=network' 2015-12-23T21:38:24.705709133Z network create 8b111217944ba0ba844a65b13efcd57dc494932ee2527577758f939315ba2c5b (name=test-event-network-local, type=bridge) 2015-12-23T21:38:25.119625123Z network connect 8b111217944ba0ba844a65b13efcd57dc494932ee2527577758f939315ba2c5b (name=test-event-network-local, container=b4be644031a3d90b400f88ab3d4bdf4dc23adb250e696b6328b85441abe2c54e, type=bridge) -$ docker system events --filter 'type=plugin' +$ docker events --filter 'type=plugin' 2016-07-25T17:30:14.825557616Z plugin pull ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/sample-volume-plugin:latest) 2016-07-25T17:30:14.888127370Z plugin enable ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/sample-volume-plugin:latest) + +$ docker events -f type=service + +2017-07-12T06:34:07.999446625Z service create wj64st89fzgchxnhiqpn8p4oj (name=reverent_albattani) +2017-07-12T06:34:21.405496207Z service remove wj64st89fzgchxnhiqpn8p4oj (name=reverent_albattani) + +$ docker events -f type=node + +2017-07-12T06:21:51.951586759Z node update 3xyz5ttp1a253q74z1thwywk9 (name=ip-172-31-23-42, state.new=ready, state.old=unknown) + +$ docker events -f type=secret + +2017-07-12T06:32:13.915704367Z secret create s8o6tmlnndrgzbmdilyy5ymju (name=new_secret) +2017-07-12T06:32:37.052647783Z secret remove s8o6tmlnndrgzbmdilyy5ymju (name=new_secret) + +$ docker events -f type=config +2017-07-12T06:44:13.349037127Z config create u96zlvzdfsyb9sg4mhyxfh3rl (name=abc) +2017-07-12T06:44:36.327694184Z config remove u96zlvzdfsyb9sg4mhyxfh3rl (name=abc) + +$ docker events --filter 'scope=swarm' + +2017-07-10T07:46:50.250024503Z service create m8qcxu8081woyof7w3jaax6gk (name=affectionate_wilson) +2017-07-10T07:47:31.093797134Z secret create 6g5pufzsv438p9tbvl9j94od4 (name=new_secret) ``` ### Format the output ```bash -$ docker system events --filter 'type=container' --format 'Type={{.Type}} Status={{.Status}} ID={{.ID}}' +$ docker events --filter 'type=container' --format 'Type={{.Type}} Status={{.Status}} ID={{.ID}}' Type=container Status=create ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 Type=container Status=attach ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299c126a87812311951e26 @@ -330,7 +402,7 @@ Type=container Status=destroy ID=2ee349dac409e97974ce8d01b70d250b85e0ba8189299 #### Format as JSON ```bash -$ docker system events --format '{{json .}}' +$ docker events --format '{{json .}}' {"status":"create","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f4.. {"status":"attach","id":"196016a57679bf42424484918746a9474cd905dd993c4d0f4.. diff --git a/docs/reference/commandline/info.md b/docs/reference/commandline/system_info.md similarity index 100% rename from docs/reference/commandline/info.md rename to docs/reference/commandline/system_info.md