github.com/clintkitson/docker@v1.9.1/man/docker-ps.1.md (about) 1 % DOCKER(1) Docker User Manuals 2 % Docker Community 3 % FEBRUARY 2015 4 # NAME 5 docker-ps - List containers 6 7 # SYNOPSIS 8 **docker ps** 9 [**-a**|**--all**[=*false*]] 10 [**--before**[=*BEFORE*]] 11 [**-f**|**--filter**[=*[]*]] 12 [**--format**=*"TEMPLATE"*] 13 [**--help**] 14 [**-l**|**--latest**[=*false*]] 15 [**-n**[=*-1*]] 16 [**--no-trunc**[=*false*]] 17 [**-q**|**--quiet**[=*false*]] 18 [**-s**|**--size**[=*false*]] 19 [**--since**[=*SINCE*]] 20 21 # DESCRIPTION 22 23 List the containers in the local repository. By default this shows only 24 the running containers. 25 26 # OPTIONS 27 **-a**, **--all**=*true*|*false* 28 Show all containers. Only running containers are shown by default. The default is *false*. 29 30 **--before**="" 31 Show only containers created before Id or Name, including non-running containers. 32 33 **-f**, **--filter**=[] 34 Provide filter values. Valid filters: 35 exited=<int> - containers with exit code of <int> 36 label=<key> or label=<key>=<value> 37 status=(created|restarting|running|paused|exited) 38 name=<string> - container's name 39 id=<ID> - container's ID 40 ancestor=(<image-name>[:tag]|<image-id>|<image@digest>) - filters containers that were 41 created from the given image or a descendant. 42 43 **--format**=*"TEMPLATE"* 44 Pretty-print containers using a Go template. 45 Valid placeholders: 46 .ID - Container ID 47 .Image - Image ID 48 .Command - Quoted command 49 .CreatedAt - Time when the container was created. 50 .RunningFor - Elapsed time since the container was started. 51 .Ports - Exposed ports. 52 .Status - Container status. 53 .Size - Container disk size. 54 .Labels - All labels asigned to the container. 55 .Label - Value of a specific label for this container. For example `{{.Label "com.docker.swarm.cpu"}}` 56 57 **--help** 58 Print usage statement 59 60 **-l**, **--latest**=*true*|*false* 61 Show only the latest created container, include non-running ones. The default is *false*. 62 63 **-n**=-1 64 Show n last created containers, include non-running ones. 65 66 **--no-trunc**=*true*|*false* 67 Don't truncate output. The default is *false*. 68 69 **-q**, **--quiet**=*true*|*false* 70 Only display numeric IDs. The default is *false*. 71 72 **-s**, **--size**=*true*|*false* 73 Display total file sizes. The default is *false*. 74 75 **--since**="" 76 Show only containers created since Id or Name, include non-running ones. 77 78 # EXAMPLES 79 # Display all containers, including non-running 80 81 # docker ps -a 82 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 83 a87ecb4f327c fedora:20 /bin/sh -c #(nop) MA 20 minutes ago Exit 0 desperate_brattain 84 01946d9d34d8 vpavlin/rhel7:latest /bin/sh -c #(nop) MA 33 minutes ago Exit 0 thirsty_bell 85 c1d3b0166030 acffc0358b9e /bin/sh -c yum -y up 2 weeks ago Exit 1 determined_torvalds 86 41d50ecd2f57 fedora:20 /bin/sh -c #(nop) MA 2 weeks ago Exit 0 drunk_pike 87 88 # Display only IDs of all containers, including non-running 89 90 # docker ps -a -q 91 a87ecb4f327c 92 01946d9d34d8 93 c1d3b0166030 94 41d50ecd2f57 95 96 # Display only IDs of all containers that have the name `determined_torvalds` 97 98 # docker ps -a -q --filter=name=determined_torvalds 99 c1d3b0166030 100 101 # Display containers with their commands 102 103 # docker ps --format "{{.ID}}: {{.Command}}" 104 a87ecb4f327c: /bin/sh -c #(nop) MA 105 01946d9d34d8: /bin/sh -c #(nop) MA 106 c1d3b0166030: /bin/sh -c yum -y up 107 41d50ecd2f57: /bin/sh -c #(nop) MA 108 109 # Display containers with their labels in a table 110 111 # docker ps --format "table {{.ID}}\t{{.Labels}}" 112 CONTAINER ID LABELS 113 a87ecb4f327c com.docker.swarm.node=ubuntu,com.docker.swarm.storage=ssd 114 01946d9d34d8 115 c1d3b0166030 com.docker.swarm.node=debian,com.docker.swarm.cpu=6 116 41d50ecd2f57 com.docker.swarm.node=fedora,com.docker.swarm.cpu=3,com.docker.swarm.storage=ssd 117 118 # Display containers with their node label in a table 119 120 # docker ps --format 'table {{.ID}}\t{{(.Label "com.docker.swarm.node")}}' 121 CONTAINER ID NODE 122 a87ecb4f327c ubuntu 123 01946d9d34d8 124 c1d3b0166030 debian 125 41d50ecd2f57 fedora 126 127 # HISTORY 128 April 2014, Originally compiled by William Henry (whenry at redhat dot com) 129 based on docker.com source material and internal work. 130 June 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> 131 August 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> 132 November 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> 133 February 2015, updated by André Martins <martins@noironetworks.com>