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