|
...
|
...
|
@@ -48,7 +48,7 @@ Docker networks report the following events:
|
|
48
|
48
|
|
|
49
|
49
|
create, connect, disconnect, destroy
|
|
50
|
50
|
|
|
51
|
|
-Docker daemon report the following events:
|
|
|
51
|
+Docker daemon reports the following events:
|
|
52
|
52
|
|
|
53
|
53
|
reload
|
|
54
|
54
|
|
|
...
|
...
|
@@ -111,91 +111,108 @@ You'll need two shells for this example.
|
|
111
|
111
|
|
|
112
|
112
|
**Shell 2: Start and Stop containers:**
|
|
113
|
113
|
|
|
114
|
|
- $ docker start 4386fb97867d
|
|
115
|
|
- $ docker stop 4386fb97867d
|
|
116
|
|
- $ docker stop 7805c1d35632
|
|
|
114
|
+ $ docker create --name test alpine:latest top
|
|
|
115
|
+ $ docker start test
|
|
|
116
|
+ $ docker stop test
|
|
117
|
117
|
|
|
118
|
118
|
**Shell 1: (Again .. now showing events):**
|
|
119
|
119
|
|
|
120
|
|
- 2015-05-12T11:51:30.999999999Z07:00 container start 4386fb97867d (image=ubuntu-1:14.04)
|
|
121
|
|
- 2015-05-12T11:51:30.999999999Z07:00 container die 4386fb97867d (image=ubuntu-1:14.04)
|
|
122
|
|
- 2015-05-12T15:52:12.999999999Z07:00 container stop 4386fb97867d (image=ubuntu-1:14.04)
|
|
123
|
|
- 2015-05-12T15:53:45.999999999Z07:00 container die 7805c1d35632 (image=redis:2.8)
|
|
124
|
|
- 2015-05-12T15:54:03.999999999Z07:00 container stop 7805c1d35632 (image=redis:2.8)
|
|
|
120
|
+ 2017-01-05T00:35:58.859401177+08:00 container create 0fdb48addc82871eb34eb23a847cfd033dedd1a0a37bef2e6d9eb3870fc7ff37 (image=alpine:latest, name=test)
|
|
|
121
|
+ 2017-01-05T00:36:04.703631903+08:00 network connect e2e1f5ceda09d4300f3a846f0acfaa9a8bb0d89e775eb744c5acecd60e0529e2 (container=0fdb...ff37, name=bridge, type=bridge)
|
|
|
122
|
+ 2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test)
|
|
|
123
|
+ 2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15)
|
|
|
124
|
+ 2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test)
|
|
|
125
|
+ 2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge)
|
|
|
126
|
+ 2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test)
|
|
125
|
127
|
|
|
126
|
128
|
**Show events in the past from a specified time:**
|
|
127
|
129
|
|
|
128
|
|
- $ docker events --since 1378216169
|
|
129
|
|
- 2015-05-12T11:51:30.999999999Z07:00 container die 4386fb97867d (image=ubuntu-1:14.04)
|
|
130
|
|
- 2015-05-12T15:52:12.999999999Z07:00 container stop 4386fb97867d (image=ubuntu-1:14.04)
|
|
131
|
|
- 2015-05-12T15:53:45.999999999Z07:00 container die 7805c1d35632 (image=redis:2.8)
|
|
132
|
|
- 2015-05-12T15:54:03.999999999Z07:00 container stop 7805c1d35632 (image=redis:2.8)
|
|
133
|
|
-
|
|
134
|
|
- $ docker events --since '2013-09-03'
|
|
135
|
|
- 2015-05-12T11:51:30.999999999Z07:00 container start 4386fb97867d (image=ubuntu-1:14.04)
|
|
136
|
|
- 2015-05-12T11:51:30.999999999Z07:00 container die 4386fb97867d (image=ubuntu-1:14.04)
|
|
137
|
|
- 2015-05-12T15:52:12.999999999Z07:00 container stop 4386fb97867d (image=ubuntu-1:14.04)
|
|
138
|
|
- 2015-05-12T15:53:45.999999999Z07:00 container die 7805c1d35632 (image=redis:2.8)
|
|
139
|
|
- 2015-05-12T15:54:03.999999999Z07:00 container stop 7805c1d35632 (image=redis:2.8)
|
|
|
130
|
+ $ docker events --since 1483283804
|
|
|
131
|
+ 2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local)
|
|
|
132
|
+ 2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test)
|
|
|
133
|
+ 2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge)
|
|
|
134
|
+ 2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test)
|
|
|
135
|
+ 2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15)
|
|
|
136
|
+ 2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test)
|
|
|
137
|
+ 2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge)
|
|
|
138
|
+ 2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test)
|
|
|
139
|
+
|
|
|
140
|
+ $ docker events --since '2017-01-05'
|
|
|
141
|
+ 2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local)
|
|
|
142
|
+ 2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test)
|
|
|
143
|
+ 2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge)
|
|
|
144
|
+ 2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test)
|
|
|
145
|
+ 2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15)
|
|
|
146
|
+ 2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test)
|
|
|
147
|
+ 2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge)
|
|
|
148
|
+ 2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test)
|
|
140
|
149
|
|
|
141
|
150
|
$ docker events --since '2013-09-03T15:49:29'
|
|
142
|
|
- 2015-05-12T11:51:30.999999999Z07:00 container die 4386fb97867d (image=ubuntu-1:14.04)
|
|
143
|
|
- 2015-05-12T15:52:12.999999999Z07:00 container stop 4386fb97867d (image=ubuntu-1:14.04)
|
|
144
|
|
- 2015-05-12T15:53:45.999999999Z07:00 container die 7805c1d35632 (image=redis:2.8)
|
|
145
|
|
- 2015-05-12T15:54:03.999999999Z07:00 container stop 7805c1d35632 (image=redis:2.8)
|
|
|
151
|
+ 2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local)
|
|
|
152
|
+ 2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test)
|
|
|
153
|
+ 2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge)
|
|
|
154
|
+ 2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test)
|
|
|
155
|
+ 2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15)
|
|
|
156
|
+ 2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test)
|
|
|
157
|
+ 2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge)
|
|
|
158
|
+ 2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test)
|
|
146
|
159
|
|
|
147
|
160
|
This example outputs all events that were generated in the last 3 minutes,
|
|
148
|
161
|
relative to the current time on the client machine:
|
|
149
|
162
|
|
|
150
|
|
- $ docker events --since '3m'
|
|
151
|
|
- 2015-05-12T11:51:30.999999999Z07:00 container die 4386fb97867d (image=ubuntu-1:14.04)
|
|
152
|
|
- 2015-05-12T15:52:12.999999999Z07:00 container stop 4386fb97867d (image=ubuntu-1:14.04)
|
|
153
|
|
- 2015-05-12T15:53:45.999999999Z07:00 container die 7805c1d35632 (image=redis:2.8)
|
|
154
|
|
- 2015-05-12T15:54:03.999999999Z07:00 container stop 7805c1d35632 (image=redis:2.8)
|
|
|
163
|
+ $ docker events --since '10m'
|
|
|
164
|
+ 2017-01-05T00:35:41.241772953+08:00 volume create testVol (driver=local)
|
|
|
165
|
+ 2017-01-05T00:35:58.859401177+08:00 container create d9cd...4d70 (image=alpine:latest, name=test)
|
|
|
166
|
+ 2017-01-05T00:36:04.703631903+08:00 network connect e2e1...29e2 (container=0fdb...ff37, name=bridge, type=bridge)
|
|
|
167
|
+ 2017-01-05T00:36:04.795031609+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test)
|
|
|
168
|
+ 2017-01-05T00:36:09.830268747+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15)
|
|
|
169
|
+ 2017-01-05T00:36:09.840186338+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test)
|
|
|
170
|
+ 2017-01-05T00:36:09.880113663+08:00 network disconnect e2e...29e2 (container=0fdb...ff37, name=bridge, type=bridge)
|
|
|
171
|
+ 2017-01-05T00:36:09.890214053+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test)
|
|
155
|
172
|
|
|
156
|
173
|
**Filter events:**
|
|
157
|
174
|
|
|
158
|
175
|
$ docker events --filter 'event=stop'
|
|
159
|
|
- 2014-05-10T17:42:14.999999999Z07:00 container stop 4386fb97867d (image=ubuntu-1:14.04)
|
|
160
|
|
- 2014-09-03T17:42:14.999999999Z07:00 container stop 7805c1d35632 (image=redis:2.8)
|
|
161
|
|
-
|
|
162
|
|
- $ docker events --filter 'image=ubuntu-1:14.04'
|
|
163
|
|
- 2014-05-10T17:42:14.999999999Z07:00 container start 4386fb97867d (image=ubuntu-1:14.04)
|
|
164
|
|
- 2014-05-10T17:42:14.999999999Z07:00 container die 4386fb97867d (image=ubuntu-1:14.04)
|
|
165
|
|
- 2014-05-10T17:42:14.999999999Z07:00 container stop 4386fb97867d (image=ubuntu-1:14.04)
|
|
166
|
|
-
|
|
167
|
|
- $ docker events --filter 'container=7805c1d35632'
|
|
168
|
|
- 2014-05-10T17:42:14.999999999Z07:00 container die 7805c1d35632 (image=redis:2.8)
|
|
169
|
|
- 2014-09-03T15:49:29.999999999Z07:00 container stop 7805c1d35632 (image= redis:2.8)
|
|
170
|
|
-
|
|
171
|
|
- $ docker events --filter 'container=7805c1d35632' --filter 'container=4386fb97867d'
|
|
172
|
|
- 2014-09-03T15:49:29.999999999Z07:00 container die 4386fb97867d (image=ubuntu-1:14.04)
|
|
173
|
|
- 2014-05-10T17:42:14.999999999Z07:00 container stop 4386fb97867d (image=ubuntu-1:14.04)
|
|
174
|
|
- 2014-05-10T17:42:14.999999999Z07:00 container die 7805c1d35632 (image=redis:2.8)
|
|
175
|
|
- 2014-09-03T15:49:29.999999999Z07:00 container stop 7805c1d35632 (image=redis:2.8)
|
|
176
|
|
-
|
|
177
|
|
- $ docker events --filter 'container=7805c1d35632' --filter 'event=stop'
|
|
178
|
|
- 2014-09-03T15:49:29.999999999Z07:00 container stop 7805c1d35632 (image=redis:2.8)
|
|
179
|
|
-
|
|
180
|
|
- $ docker events --filter 'container=container_1' --filter 'container=container_2'
|
|
181
|
|
- 2014-09-03T15:49:29.999999999Z07:00 container die 4386fb97867d (image=ubuntu-1:14.04)
|
|
182
|
|
- 2014-05-10T17:42:14.999999999Z07:00 container stop 4386fb97867d (image=ubuntu-1:14.04)
|
|
183
|
|
- 2014-05-10T17:42:14.999999999Z07:00 container die 7805c1d35632 (imager=redis:2.8)
|
|
184
|
|
- 2014-09-03T15:49:29.999999999Z07:00 container stop 7805c1d35632 (image=redis:2.8)
|
|
|
176
|
+ 2017-01-05T00:40:22.880175420+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test)
|
|
|
177
|
+ 2017-01-05T00:41:17.888104182+08:00 container stop 2a8f...4e78 (image=alpine, name=kickass_brattain)
|
|
|
178
|
+
|
|
|
179
|
+ $ docker events --filter 'image=alpine'
|
|
|
180
|
+ 2017-01-05T00:41:55.784240236+08:00 container create d9cd...4d70 (image=alpine, name=happy_meitner)
|
|
|
181
|
+ 2017-01-05T00:41:55.913156783+08:00 container start d9cd...4d70 (image=alpine, name=happy_meitner)
|
|
|
182
|
+ 2017-01-05T00:42:01.106875249+08:00 container kill d9cd...4d70 (image=alpine, name=happy_meitner, signal=15)
|
|
|
183
|
+ 2017-01-05T00:42:11.111934041+08:00 container kill d9cd...4d70 (image=alpine, name=happy_meitner, signal=9)
|
|
|
184
|
+ 2017-01-05T00:42:11.119578204+08:00 container die d9cd...4d70 (exitCode=137, image=alpine, name=happy_meitner)
|
|
|
185
|
+ 2017-01-05T00:42:11.173276611+08:00 container stop d9cd...4d70 (image=alpine, name=happy_meitner)
|
|
|
186
|
+
|
|
|
187
|
+ $ docker events --filter 'container=test'
|
|
|
188
|
+ 2017-01-05T00:43:00.139719934+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test)
|
|
|
189
|
+ 2017-01-05T00:43:09.259951086+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=15)
|
|
|
190
|
+ 2017-01-05T00:43:09.270102715+08:00 container die 0fdb...ff37 (exitCode=143, image=alpine:latest, name=test)
|
|
|
191
|
+ 2017-01-05T00:43:09.312556440+08:00 container stop 0fdb...ff37 (image=alpine:latest, name=test)
|
|
|
192
|
+
|
|
|
193
|
+ $ docker events --filter 'container=test' --filter 'container=d9cdb1525ea8'
|
|
|
194
|
+ 2017-01-05T00:44:11.517071981+08:00 container start 0fdb...ff37 (image=alpine:latest, name=test)
|
|
|
195
|
+ 2017-01-05T00:44:17.685870901+08:00 container start d9cd...4d70 (image=alpine, name=happy_meitner)
|
|
|
196
|
+ 2017-01-05T00:44:29.757658470+08:00 container kill 0fdb...ff37 (image=alpine:latest, name=test, signal=9)
|
|
|
197
|
+ 2017-01-05T00:44:29.767718510+08:00 container die 0fdb...ff37 (exitCode=137, image=alpine:latest, name=test)
|
|
|
198
|
+ 2017-01-05T00:44:29.815798344+08:00 container destroy 0fdb...ff37 (image=alpine:latest, name=test)
|
|
|
199
|
+
|
|
|
200
|
+ $ docker events --filter 'container=test' --filter 'event=stop'
|
|
|
201
|
+ 2017-01-05T00:46:13.664099505+08:00 container stop a9d1...e130 (image=alpine, name=test)
|
|
185
|
202
|
|
|
186
|
203
|
$ docker events --filter 'type=volume'
|
|
187
|
204
|
2015-12-23T21:05:28.136212689Z volume create test-event-volume-local (driver=local)
|
|
188
|
|
- 2015-12-23T21:05:28.383462717Z volume mount test-event-volume-local (read/write=true, container=562fe10671e9273da25eed36cdce26159085ac7ee6707105fd534866340a5025, destination=/foo, driver=local, propagation=rprivate)
|
|
189
|
|
- 2015-12-23T21:05:28.650314265Z volume unmount test-event-volume-local (container=562fe10671e9273da25eed36cdce26159085ac7ee6707105fd534866340a5025, driver=local)
|
|
|
205
|
+ 2015-12-23T21:05:28.383462717Z volume mount test-event-volume-local (read/write=true, container=562f...5025, destination=/foo, driver=local, propagation=rprivate)
|
|
|
206
|
+ 2015-12-23T21:05:28.650314265Z volume unmount test-event-volume-local (container=562f...5025, driver=local)
|
|
190
|
207
|
2015-12-23T21:05:28.716218405Z volume destroy test-event-volume-local (driver=local)
|
|
191
|
208
|
|
|
192
|
209
|
$ docker events --filter 'type=network'
|
|
193
|
|
- 2015-12-23T21:38:24.705709133Z network create 8b111217944ba0ba844a65b13efcd57dc494932ee2527577758f939315ba2c5b (name=test-event-network-local, type=bridge)
|
|
194
|
|
- 2015-12-23T21:38:25.119625123Z network connect 8b111217944ba0ba844a65b13efcd57dc494932ee2527577758f939315ba2c5b (name=test-event-network-local, container=b4be644031a3d90b400f88ab3d4bdf4dc23adb250e696b6328b85441abe2c54e, type=bridge)
|
|
|
210
|
+ 2015-12-23T21:38:24.705709133Z network create 8b11...2c5b (name=test-event-network-local, type=bridge)
|
|
|
211
|
+ 2015-12-23T21:38:25.119625123Z network connect 8b11...2c5b (name=test-event-network-local, container=b4be...c54e, type=bridge)
|
|
195
|
212
|
|
|
196
|
213
|
$ docker events --filter 'type=plugin' (experimental)
|
|
197
|
|
- 2016-07-25T17:30:14.825557616Z plugin pull ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/sample-volume-plugin:latest)
|
|
198
|
|
- 2016-07-25T17:30:14.888127370Z plugin enable ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/sample-volume-plugin:latest)
|
|
|
214
|
+ 2016-07-25T17:30:14.825557616Z plugin pull ec7b...993f (name=tiborvass/sample-volume-plugin:latest)
|
|
|
215
|
+ 2016-07-25T17:30:14.888127370Z plugin enable ec7b...993f (name=tiborvass/sample-volume-plugin:latest)
|
|
199
|
216
|
|
|
200
|
217
|
**Format:**
|
|
201
|
218
|
|