{"id":15098,"date":"2016-11-08T16:15:24","date_gmt":"2016-11-08T14:15:24","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=15098"},"modified":"2017-12-19T12:26:10","modified_gmt":"2017-12-19T10:26:10","slug":"docker-list-containers-example","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/","title":{"rendered":"Docker List Containers Example"},"content":{"rendered":"<p>This example will show you how to list containers with Docker, one of the most popular software of the moment. Apart from just listing the containers, we will see the useful options that this command is provided with.<\/p>\n<p>For this example, Linux Mint 18 and Docker version 1.12.1 have been used.<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n[ulp id=&#8217;OCKUMTbC259tpbxG&#8217;]<\/p>\n<div class=\"tip\"><strong>Tip<\/strong><br \/>\nYou may skip Docker installation and jump directly to the <a href=\"#section_2\"><strong>beginning of the example<\/strong><\/a> below.<\/div>\n<h2>1. Installation<\/h2>\n<p><strong>Note<\/strong>: Docker requires a 64-bit system with a kernel version equal or higher to 3.10.<\/p>\n<p>We can install Docker simply via <code>apt-get<\/code>, without the need of adding any repository, just installing the <code>docker.io<\/code> package:<\/p>\n<pre class=\"brush:bash\">sudo apt-get update\r\nsudo apt-get install docker.io<\/pre>\n<p>For more details, you can follow the <a href=\"https:\/\/www.webcodegeeks.com\/devops\/install-docker-ubuntu-tutorial\/\">Install Docker on Ubuntu Tutorial<\/a>.<\/p>\n<h2 id=\"section_2\">2. Setting up some containers<\/h2>\n<h3>2.1. Pulling a sample image<\/h3>\n<p>As you should know, before creating containers, we need Docker images.<\/p>\n<p>The easiest way to obtain a Docker image is to pull one from the Docker Hub. You don&#8217;t have to have an account for pulling images.<\/p>\n<p>Let&#8217;s pull a Busybox image:<\/p>\n<pre class=\"brush:bash\"><code class=\"plain\">docker pull busybox<\/code><\/pre>\n<h3>2.2. Creating sample containers<\/h3>\n<p>Let&#8217;s create several containers:<\/p>\n<pre class=\"brush:bash\">docker run busybox\r\ndocker run busybox echo \"Hello world\"\r\ndocker run --name=mybusybox busybox\r\ndocker run -it busybox<\/pre>\n<p><strong>Note<\/strong>: after the last container execution, open a new terminal, since the have set the interactive mode for it.<\/p>\n<h2>3. Listing containers<\/h2>\n<p>The Docker command for listing containers is <code>ps<\/code> (yes, not a very good name). So, let&#8217;s try it:<\/p>\n<pre class=\"brush:bash\">docker ps<\/pre>\n<p>For which will return an output like the following:<\/p>\n<pre class=\"brush:bash;wrap-lines:false\">CONTAINER ID\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IMAGE\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 COMMAND\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 CREATED\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 STATUS\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 PORTS\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 NAMES\r\ne723bc39fdd9\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 busybox\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"sh\"\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 3 minutes ago\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Up 3 minutes\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 jolly_bhabha<\/pre>\n<p>The first thing that probably will come to our minds is that we are just seeing a single container, when we actually instantiated several of them.<strong> This is because <code>ps<\/code> command just shows the active, running containers<\/strong>. And, actually, we only have a single container running: the one we instantiated interactively.<\/p>\n<p>If we want to show all the containers, we have to pass the <code>-a<\/code> (<code>--all<\/code>) option to <code>ps<\/code>:<\/p>\n<pre class=\"brush:bash\">docker ps -a<\/pre>\n<p>In this case, the output would be:<\/p>\n<pre class=\"brush:bash;wrap-lines:false\">CONTAINER ID\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IMAGE\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 COMMAND\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 CREATED\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 STATUS\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 PORTS\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 NAMES\r\ne723bc39fdd9\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 busybox\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"sh\"\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 3 minutes ago\u00a0\u00a0     Up 3 minutes\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0     jolly_bhabha\r\n642aec18d638\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 busybox\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"sh\"\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 3 minutes ago\u00a0\u00a0     Exited (0) 3 minutes ago\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0     mybusybox\r\nfe574b4fcca5\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 busybox\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"sh\"\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 3 minutes ago\u00a0\u00a0     Exited (0) 3 minutes ago\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0     grave_ramanujan\r\n0583be5c5598\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 busybox\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"echo 'Hello world'\"\u00a0\u00a0\u00a0\u00a0 3 minutes ago\u00a0\u00a0     Exited (0) 3 minutes ago\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0     pedantic_hoover\r\ne4ceead785b3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 busybox\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \"sh\"\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 3 minutes ago\u00a0\u00a0     Exited (0) 3 minutes ago\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0     cranky_murdock<\/pre>\n<h3>3.1. Formatting the output<\/h3>\n<p>You may find the <code>ps<\/code> output not very pretty, since the lines can be wrapped if the width of the terminal window is not big enough. Fortunately, this command allows custom formatting. This is achieved with the <code>--format<\/code> option. The format is specified in &#8220;Go Template&#8221;, which is pretty easy:<\/p>\n<pre class=\"brush:bash;wrap-lines:false\">docker ps --format '{{.&lt;column-name1&gt;}}[ {{.&lt;column-nameN&gt;}} ]'<\/pre>\n<p>Specifying as many columns as we want. Of course, the formatting is compatible with <code>-a<\/code> option.<\/p>\n<p>For example, if we would just want to see the names, we could execute:<\/p>\n<pre class=\"brush:bash;wrap-lines:false\">docker ps -a --format '{{ .Names }} {{ .Status }}'<\/pre>\n<p>Which would show:<\/p>\n<pre class=\"brush:bash;wrap-lines:false\">jolly_bhabha Exited (0) 5 minutes ago\r\nmybusybox Exited (0) 5 minutes ago\r\ngrave_ramanujan Exited (0) 5 minutes ago\r\npedantic_hoover Exited (0) 5 minutes ago\r\ncranky_murdock Exited (0) 5 minutes ago<\/pre>\n<p>The name of the fields are case sensitive, and for same cases the field name we have to use with <code>--format<\/code> is not very intuitive. So this is the list of the field name we have to use for each column:<\/p>\n<ul>\n<li><code>CONTAINER ID<\/code>: <code>ID<\/code><\/li>\n<li><code>IMAGE<\/code>: <code>Image<\/code><\/li>\n<li><code>COMMAND<\/code>: <code>Command<\/code><\/li>\n<li><code>CREATED<\/code>: <code>RunningFor<\/code><\/li>\n<li><code>STATUS<\/code>: <code>Status<\/code><\/li>\n<li><code>PORTS<\/code>: <code>Ports<\/code><\/li>\n<li><code>NAMES<\/code>: <code>Names<\/code><\/li>\n<\/ul>\n<p>Note that the fields which were named <code>CONTAINER ID<\/code> and <code>CREATED<\/code>, use completely different names for the formatting. If we want to show the header for each column, we can add the <code>table<\/code> identifier before we specify the format, for example:<\/p>\n<pre class=\"brush:bash;wrap-lines:false\">docker ps -a --format 'table {{ .ID }} {{ .Names }}'<\/pre>\n<p>Which would make the output look like:<\/p>\n<pre class=\"brush:bash;wrap-lines:false\">CONTAINER ID\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 NAMES\r\ne723bc39fdd9 jolly_bhabha\r\n642aec18d638 mybusybox\r\nfe574b4fcca5 grave_ramanujan\r\n0583be5c5598 pedantic_hoover\r\ne4ceead785b3 cranky_murdock<\/pre>\n<p>And, to align each column, we can use the tabulation <code>\\t<\/code> character between each one:<\/p>\n<pre class=\"brush:bash;wrap-lines:false\">docker ps -a --format 'table {{ .ID }}\\t{{ .Names }}'<\/pre>\n<p>Having a nicer formatting:<\/p>\n<pre class=\"brush:bash;wrap-lines:false\">CONTAINER ID\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 NAMES\r\ne723bc39fdd9\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 jolly_bhabha\r\n642aec18d638\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 mybusybox\r\nfe574b4fcca5\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 grave_ramanujan\r\n0583be5c5598\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 pedantic_hoover\r\ne4ceead785b3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 cranky_murdock<\/pre>\n<h3>3.2. Saving format templates in Docker configuration file<\/h3>\n<p>We have seen how useful can be the custom formatting for container outputting. But, on the other hand, it requires to write quite a lot, which perhaps make thing that it&#8217;s not worth.<\/p>\n<p>Fortunately, Docker allows to define a default formatting configuration for the <code>ps<\/code> command, so, every time we execute it, it will show the output as defined, without the need of specifying the <code>--format<\/code> option.<\/p>\n<p>For this, we just have to open the <code>config.json<\/code> file with our favorite editor, located in the <code>.docker\/<\/code> folder, in the home directory:<\/p>\n<pre class=\"brush:bash;wrap-lines:false\">vim ~\/.docker\/config.json<\/pre>\n<p>And add a <code>--table<\/code> value for the <code>psFormat<\/code> entry, e.g.:<\/p>\n<pre class=\"brush:javascript;wrap-lines:false\">{\r\n    \"psFormat\": \"table {{ .ID }}\\t{{ .Names }}\\t{{ .Status }}\"\r\n}<\/pre>\n<p>Now, just executing the following Docker command:<\/p>\n<pre class=\"brush:bash;wrap-lines:false\">docker ps -a<\/pre>\n<p>The output would be:<\/p>\n<pre class=\"brush:bash;wrap-lines:false\">CONTAINER ID\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 NAMES\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 STATUS\r\ne723bc39fdd9\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 jolly_bhabha\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Exited (0) 10 minutes ago\r\n642aec18d638\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 mybusybox\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Exited (0) 10 minutes ago\r\nfe574b4fcca5\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 grave_ramanujan\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Exited (0) 10 minutes ago\r\n0583be5c5598\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 pedantic_hoover\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Exited (0) 10 minutes ago\r\ne4ceead785b3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 cranky_murdock\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Exited (0) 10 minutes ago<\/pre>\n<h3>3.3. Using filters<\/h3>\n<p>The remaining interesting feature for container listing is the filtering of the results. This is useful if we are dealing with several containers, and we just want information about some of them.<\/p>\n<p>For filtering the output, the option <code>-f<\/code> (<code>--format<\/code>) is used. The format is the following:<\/p>\n<pre class=\"brush:bash;wrap-lines:false\">docker ps -f \"key1=value1\" -f \"key2=value2\" -f \"keyN=valueN\"<\/pre>\n<p>As you can see, we can specify as many filters as we want, but, for each of them, we have to specify the filter option.<\/p>\n<p>For example, we could filter by the container name:<\/p>\n<pre class=\"brush:bash;wrap-lines:false\">docker ps -a -f \"name=mybusybox\"<\/pre>\n<p>Showing the following output:<\/p>\n<pre class=\"brush:bash;wrap-lines:false\">CONTAINER ID\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 NAMES\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 STATUS\r\n642aec18d638\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 mybusybox\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Exited (0) 15 minutes ago<\/pre>\n<p>(Keeping the configuration as we saw in previous section).<\/p>\n<p>The filter also supports regular expressions, for example:<\/p>\n<pre class=\"brush:bash;wrap-lines:false\">docker ps -a -f \"name=\/*_\"<\/pre>\n<p>Looking for container names with an underscore, outputting:<\/p>\n<pre class=\"brush:bash;wrap-lines:false\">CONTAINER ID\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 NAMES\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 STATUS\r\ne723bc39fdd9\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 jolly_bhabha\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Exited (0) 15 minutes ago\r\nfe574b4fcca5\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 grave_ramanujan\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Exited (0) 15 minutes ago\r\n0583be5c5598\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 pedantic_hoover\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Exited (0) 15 minutes ago\r\ne4ceead785b3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 cranky_murdock\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Exited (0) 15 minutes ago<\/pre>\n<h2>4. Summary<\/h2>\n<p>In this tutorial, we have seen how to list containers created with Docker. But we have gone further than that: we have seen the options that the command for listing containers provide, to make the output prettier and more suitable for our needs, seeing also how to save the configuration to use it as default.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This example will show you how to list containers with Docker, one of the most popular software of the moment. Apart from just listing the containers, we will see the useful options that this command is provided with. For this example, Linux Mint 18 and Docker version 1.12.1 have been used. &nbsp; &nbsp; &nbsp; &nbsp; &hellip;<\/p>\n","protected":false},"author":160,"featured_media":10356,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[217],"class_list":["post-15098","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","tag-docker"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Docker List Containers Example - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"This example will show you how to list containers with Docker, one of the most popular software of the moment. Apart from just listing the containers, we\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Docker List Containers Example - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"This example will show you how to list containers with Docker, one of the most popular software of the moment. Apart from just listing the containers, we\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2016-11-08T14:15:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-12-19T10:26:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Toni\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Toni\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/\"},\"author\":{\"name\":\"Toni\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/54a7be647b0b871cff41cbf3d2a95966\"},\"headline\":\"Docker List Containers Example\",\"datePublished\":\"2016-11-08T14:15:24+00:00\",\"dateModified\":\"2017-12-19T10:26:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/\"},\"wordCount\":768,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\",\"keywords\":[\"Docker\"],\"articleSection\":[\"DevOps\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/\",\"name\":\"Docker List Containers Example - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\",\"datePublished\":\"2016-11-08T14:15:24+00:00\",\"dateModified\":\"2017-12-19T10:26:10+00:00\",\"description\":\"This example will show you how to list containers with Docker, one of the most popular software of the moment. Apart from just listing the containers, we\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"DevOps\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/devops\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Docker List Containers Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/54a7be647b0b871cff41cbf3d2a95966\",\"name\":\"Toni\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/21c1661474c78b4757355b8beef9ab1d14f490ee3a3e67392f4e618d36643d4c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/21c1661474c78b4757355b8beef9ab1d14f490ee3a3e67392f4e618d36643d4c?s=96&d=mm&r=g\",\"caption\":\"Toni\"},\"url\":\"https:\/\/www.webcodegeeks.com\/author\/julen-pardo\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Docker List Containers Example - Web Code Geeks - 2026","description":"This example will show you how to list containers with Docker, one of the most popular software of the moment. Apart from just listing the containers, we","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/","og_locale":"en_US","og_type":"article","og_title":"Docker List Containers Example - Web Code Geeks - 2026","og_description":"This example will show you how to list containers with Docker, one of the most popular software of the moment. Apart from just listing the containers, we","og_url":"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_published_time":"2016-11-08T14:15:24+00:00","article_modified_time":"2017-12-19T10:26:10+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","type":"image\/jpeg"}],"author":"Toni","twitter_card":"summary_large_image","twitter_creator":"@webcodegeeks","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Toni","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/"},"author":{"name":"Toni","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/54a7be647b0b871cff41cbf3d2a95966"},"headline":"Docker List Containers Example","datePublished":"2016-11-08T14:15:24+00:00","dateModified":"2017-12-19T10:26:10+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/"},"wordCount":768,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","keywords":["Docker"],"articleSection":["DevOps"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/","url":"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/","name":"Docker List Containers Example - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","datePublished":"2016-11-08T14:15:24+00:00","dateModified":"2017-12-19T10:26:10+00:00","description":"This example will show you how to list containers with Docker, one of the most popular software of the moment. Apart from just listing the containers, we","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/01\/docker-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/devops\/docker-list-containers-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"DevOps","item":"https:\/\/www.webcodegeeks.com\/category\/devops\/"},{"@type":"ListItem","position":3,"name":"Docker List Containers Example"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/54a7be647b0b871cff41cbf3d2a95966","name":"Toni","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/21c1661474c78b4757355b8beef9ab1d14f490ee3a3e67392f4e618d36643d4c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/21c1661474c78b4757355b8beef9ab1d14f490ee3a3e67392f4e618d36643d4c?s=96&d=mm&r=g","caption":"Toni"},"url":"https:\/\/www.webcodegeeks.com\/author\/julen-pardo\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/15098","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/160"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=15098"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/15098\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/10356"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=15098"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=15098"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=15098"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}