This example was added in b0b2f979c7c43e2975d5e39340c168da2da42d1d,
but got lost during splitting up the cli.md docs into separate files;
561bfb268de3c674b04d48895b7e46ae890ef795
This restores the missing example.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| ... | ... |
@@ -138,6 +138,23 @@ ea09c3c82f6e registry:latest /srv/run.sh 2 weeks ago |
| 138 | 138 |
48ee228c9464 fedora:20 bash 2 weeks ago Exited (0) 2 weeks ago tender_torvalds |
| 139 | 139 |
``` |
| 140 | 140 |
|
| 141 |
+#### Killed containers |
|
| 142 |
+ |
|
| 143 |
+You can use a filter to locate containers that exited with status of `137` |
|
| 144 |
+meaning a `SIGKILL(9)` killed them. |
|
| 145 |
+ |
|
| 146 |
+```bash |
|
| 147 |
+$ docker ps -a --filter 'exited=137' |
|
| 148 |
+CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
|
| 149 |
+b3e1c0ed5bfe ubuntu:latest "sleep 1000" 12 seconds ago Exited (137) 5 seconds ago grave_kowalevski |
|
| 150 |
+a2eb5558d669 redis:latest "/entrypoint.sh redi 2 hours ago Exited (137) 2 hours ago sharp_lalande |
|
| 151 |
+ |
|
| 152 |
+Any of these events result in a `137` status: |
|
| 153 |
+ |
|
| 154 |
+* the `init` process of the container is killed manually |
|
| 155 |
+* `docker kill` kills the container |
|
| 156 |
+* Docker daemon restarts which kills all running containers |
|
| 157 |
+ |
|
| 141 | 158 |
#### Status |
| 142 | 159 |
|
| 143 | 160 |
The `status` filter matches containers by status. You can filter using |