{"id":20230,"date":"2016-10-20T12:37:35","date_gmt":"2016-10-20T11:37:35","guid":{"rendered":"https:\/\/aidanfinn.com\/?p=20230"},"modified":"2016-10-20T16:46:58","modified_gmt":"2016-10-20T15:46:58","slug":"how-to-use-docker-to-stop-and-remove-all-windows-server-containers","status":"publish","type":"post","link":"https:\/\/aidanfinn.com\/?p=20230","title":{"rendered":"How To Use Docker To Stop And Remove All Windows Server Containers"},"content":{"rendered":"<p>I\u2019ve been playing around with Containers on Windows Server 2016 GA. I can\u2019t say I\u2019m enthralled with Docker being the default interface for Containers now, but I understand Microsoft\u2019s motivation.<\/p>\n<p>I needed a way to quickly:<\/p>\n<ul>\n<li>Stop all running containers on a host<\/li>\n<li>Remove all containers from the host<\/li>\n<\/ul>\n<p>If this was PowerShell, it would have been easy. But dragging open source onto Windows causes issues \u2026. they do things inconsistently and all the docs are for Linux. Grep! Really!?!?<\/p>\n<p>Eventually I found 1 variation of a solution that worked. The first line stops all running containers:<\/p>\n<pre class=\"lang:default decode:true\">docker stop (docker ps \u2013qa)<\/pre>\n<p>The second line removes all running containers:<\/p>\n<pre class=\"lang:default decode:true  \">docker rm (docker ps \u2013qa)<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I\u2019ve been playing around with Containers on Windows Server 2016 GA. I can\u2019t say I\u2019m enthralled with Docker being the default interface for Containers now, but I understand Microsoft\u2019s motivation. I needed a way to quickly: Stop all running containers on a host Remove all containers from the host If this was PowerShell, it would &hellip; <a href=\"https:\/\/aidanfinn.com\/?p=20230\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How To Use Docker To Stop And Remove All Windows Server Containers&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":18923,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-20230","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/aidanfinn.com\/wp-content\/uploads\/2015\/09\/12852909293_721a777fa2_z_d1.jpg","amp_enabled":true,"_links":{"self":[{"href":"https:\/\/aidanfinn.com\/index.php?rest_route=\/wp\/v2\/posts\/20230","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aidanfinn.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aidanfinn.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aidanfinn.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aidanfinn.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=20230"}],"version-history":[{"count":3,"href":"https:\/\/aidanfinn.com\/index.php?rest_route=\/wp\/v2\/posts\/20230\/revisions"}],"predecessor-version":[{"id":20235,"href":"https:\/\/aidanfinn.com\/index.php?rest_route=\/wp\/v2\/posts\/20230\/revisions\/20235"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/aidanfinn.com\/index.php?rest_route=\/wp\/v2\/media\/18923"}],"wp:attachment":[{"href":"https:\/\/aidanfinn.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=20230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aidanfinn.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=20230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aidanfinn.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=20230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}