docker-ps(1)

NAME

   docker-ps - List containers

SYNOPSIS

   docker ps [-a|--all] [-f|--filter[=[]]] [--format="TEMPLATE"] [--help]
   [-l|--latest] [-n[=-1]] [--no-trunc] [-q|--quiet] [-s|--size]

DESCRIPTION

   List the containers in the local repository. By default this shows only
   the running containers.

OPTIONS

   -a, --all=true|false
      Show all containers. Only running containers are shown by default.
   The default is false.

   -f, --filter=[]
      Filter output based on these conditions:
      - exited=<int> an exit code of <int>
      - label=<key> or label=<key>=<value>
      - status=(created|restarting|running|paused|exited|dead)
      - name=<string> a container's name
      - id=<ID> a container's ID
      - before=(<container-name>|<container-id>)
      - since=(<container-name>|<container-id>)
      - ancestor=(<image-name>[:tag]|<image-id>| image@digest) -
   containers created from an image or a descendant.
      - volume=(<volume-name>|<mount-point-destination>)
      - network=(<network-name>|<network-id>) - containers connected to
   the provided network

   --format="TEMPLATE"
      Pretty-print containers using a Go template.
      Valid placeholders:
         .ID - Container ID
         .Image - Image ID
         .Command - Quoted command
         .CreatedAt - Time when the container was created.
         .RunningFor - Elapsed time since the container was started.
         .Ports - Exposed ports.
         .Status - Container status.
         .Size - Container disk size.
         .Names - Container names.
         .Labels - All labels assigned to the container.
         .Label - Value of a specific label for this container. For
   example {{.Label "com.docker.swarm.cpu"}}
         .Mounts - Names of the volumes mounted in this container.

   --help
     Print usage statement

   -l, --latest=true|false
      Show only the latest created container (includes all states). The
   default is false.

   -n=-1
      Show n last created containers (includes all states).

   --no-trunc=true|false
      Don't truncate output. The default is false.

   -q, --quiet=true|false
      Only display numeric IDs. The default is false.

   -s, --size=true|false
      Display total file sizes. The default is false.

EXAMPLES

Display all containers, including non-running

          # docker ps -a
          CONTAINER ID        IMAGE                 COMMAND                CREATED             STATUS      PORTS    NAMES
          a87ecb4f327c        fedora:20             /bin/sh -c #(nop) MA   20 minutes ago      Exit 0               desperate_brattain
          01946d9d34d8        vpavlin/rhel7:latest  /bin/sh -c #(nop) MA   33 minutes ago      Exit 0               thirsty_bell
          c1d3b0166030        acffc0358b9e          /bin/sh -c yum -y up   2 weeks ago         Exit 1               determined_torvalds
          41d50ecd2f57        fedora:20             /bin/sh -c #(nop) MA   2 weeks ago         Exit 0               drunk_pike

Display only IDs of all containers, including non-running

          # docker ps -a -q
          a87ecb4f327c
          01946d9d34d8
          c1d3b0166030
          41d50ecd2f57

Display only IDs of all containers that have the name determined_torvalds

          # docker ps -a -q --filter=name=determined_torvalds
          c1d3b0166030

Display containers with their commands

          # docker ps --format "{{.ID}}: {{.Command}}"
          a87ecb4f327c: /bin/sh -c #(nop) MA
          01946d9d34d8: /bin/sh -c #(nop) MA
          c1d3b0166030: /bin/sh -c yum -y up
          41d50ecd2f57: /bin/sh -c #(nop) MA

Display containers with their labels in a table

          # docker ps --format "table {{.ID}}\t{{.Labels}}"
          CONTAINER ID        LABELS
          a87ecb4f327c        com.docker.swarm.node=ubuntu,com.docker.swarm.storage=ssd
          01946d9d34d8
          c1d3b0166030        com.docker.swarm.node=debian,com.docker.swarm.cpu=6
          41d50ecd2f57        com.docker.swarm.node=fedora,com.docker.swarm.cpu=3,com.docker.swarm.storage=ssd

Display containers with their node label in a table

          # docker ps --format 'table {{.ID}}\t{{(.Label "com.docker.swarm.node")}}'
          CONTAINER ID        NODE
          a87ecb4f327c        ubuntu
          01946d9d34d8
          c1d3b0166030        debian
          41d50ecd2f57        fedora

Display containers with remote-volume mounted
          $ docker ps --filter volume=remote-volume --format "table {{.ID}}\t{{.Mounts}}"
          CONTAINER ID        MOUNTS
          9c3527ed70ce        remote-volume

Display containers with a volume mounted in /data

          $ docker ps --filter volume=/data --format "table {{.ID}}\t{{.Mounts}}"
          CONTAINER ID        MOUNTS
          9c3527ed70ce        remote-volume

HISTORY

   April 2014, Originally compiled by William Henry (whenry at redhat dot
   com) based on docker.com source material and internal work.  June 2014,
   updated by Sven Dowideit [email protected] August 2014,
   updated by Sven Dowideit [email protected] November 2014,
   updated by Sven Dowideit [email protected] February 2015,
   updated by Andr Martins [email protected]



Opportunity


Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.

Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.


Free Software


Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.

Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.


Free Books


The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.

Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.


Education


Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.

Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.