From 1f269e43a418715c07665de3cd6359a9a83aa976 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 26 Mar 2014 14:58:33 -0400 Subject: [PATCH] filters, for images: docs Docker-DCO-1.1-Signed-off-by: Vincent Batts (github: vbatts) --- docs/sources/reference/commandline/cli.rst | 26 +++++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/docs/sources/reference/commandline/cli.rst b/docs/sources/reference/commandline/cli.rst index 6af6a85c87..dc83b0cd43 100644 --- a/docs/sources/reference/commandline/cli.rst +++ b/docs/sources/reference/commandline/cli.rst @@ -598,12 +598,13 @@ To see how the ``docker:latest`` image was built: List images -a, --all=false: Show all images (by default filter out the intermediate images used to build) + -f, --filter=[]: Provide filter values (i.e. 'tagged=false') --no-trunc=false: Don't truncate output -q, --quiet=false: Only show numeric IDs -t, --tree=false: Output graph in tree format - -u, --untagged show only untagged images -v, --viz=false: Output graph in graphviz format + Listing the most recently created images ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -678,12 +679,25 @@ Displaying image hierarchy └─c96a99614930 Size: 12.29 kB (virtual 642.2 MB) └─a6a357a48c49 Size: 12.29 kB (virtual 642.2 MB) Tags: ndj/mongodb:latest -Displaying untagged (orphan) images -~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Filtering +~~~~~~~~~ + +The filtering flag (-f or --filter) format is of "key=value". If there are more +than one flag, then either semi-colon delimit (";"), or pass multiple flags. + +Current filters: + * tagged (boolean - true or false) + * untagged (boolean - true or false) + + + +Filtering for untagged images +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: bash - $ sudo docker images --untagged + $ sudo docker images --filter "tagged=false" REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE 8abc22fbb042 4 weeks ago 0 B @@ -702,7 +716,7 @@ By having this flag it allows for batch cleanup. .. code-block:: bash - $ sudo docker images --untagged -q + $ sudo docker images -f "untagged=true" -q 8abc22fbb042 48e5f45168b9 @@ -716,7 +730,7 @@ Ready for use by `docker rmi ...`, like: .. code-block:: bash - $ sudo docker rmi $(sudo docker images --untagged -q) + $ sudo docker rmi $(sudo docker images -f "untagged=true" -q) 8abc22fbb042 48e5f45168b9