Browse code

Before and since filters documentation

Signed-off-by: Tomasz Kopczynski <tomek@kopczynski.net.pl>

Tomasz Kopczynski authored on 2016/02/10 04:37:33
Showing 1 changed files
... ...
@@ -57,6 +57,8 @@ The currently supported filters are:
57 57
 * exited (int - the code of exited containers. Only useful with `--all`)
58 58
 * status (created|restarting|running|paused|exited|dead)
59 59
 * ancestor (`<image-name>[:<tag>]`,  `<image id>` or `<image@digest>`) - filters containers that were created from the given image or a descendant.
60
+* before (container's id or name) - filters containers created before given id or name
61
+* since (container's id or name) - filters containers created since given id or name
60 62
 * isolation (default|process|hyperv)   (Windows daemon only)
61 63
 
62 64
 
... ...
@@ -163,6 +165,34 @@ in it's layer stack.
163 163
     CONTAINER ID        IMAGE               COMMAND             CREATED              STATUS              PORTS               NAMES
164 164
     82a598284012        ubuntu:12.04.5      "top"               3 minutes ago        Up 3 minutes                            sleepy_bose
165 165
 
166
+#### Before
167
+
168
+The `before` filter shows only containers created before the container with given id or name. For example, 
169
+having these containers created:
170
+
171
+    $ docker ps
172
+    CONTAINER ID        IMAGE       COMMAND       CREATED              STATUS              PORTS              NAMES
173
+    9c3527ed70ce        busybox     "top"         14 seconds ago       Up 15 seconds                          desperate_dubinsky
174
+    4aace5031105        busybox     "top"         48 seconds ago       Up 49 seconds                          focused_hamilton
175
+    6e63f6ff38b0        busybox     "top"         About a minute ago   Up About a minute                      distracted_fermat
176
+
177
+Filtering with `before` would give:
178
+
179
+    $ docker ps -f before=9c3527ed70ce
180
+    CONTAINER ID        IMAGE       COMMAND       CREATED              STATUS              PORTS              NAMES
181
+    4aace5031105        busybox     "top"         About a minute ago   Up About a minute                      focused_hamilton
182
+    6e63f6ff38b0        busybox     "top"         About a minute ago   Up About a minute                      distracted_fermat
183
+
184
+#### Since
185
+
186
+The `since` filter shows only containers created since the container with given id or name. For example,
187
+with the same containers as in `before` filter:
188
+
189
+    $ docker ps -f since=6e63f6ff38b0
190
+    CONTAINER ID        IMAGE       COMMAND       CREATED             STATUS              PORTS               NAMES
191
+    9c3527ed70ce        busybox     "top"         10 minutes ago      Up 10 minutes                           desperate_dubinsky
192
+    4aace5031105        busybox     "top"         10 minutes ago      Up 10 minutes                           focused_hamilton
193
+
166 194
 
167 195
 ## Formatting
168 196