How To Use Docker To Stop And Remove All Windows Server Containers

[Image credit: Paul Townsend, https://www.flickr.com/photos/brizzlebornandbred/]

I’ve been playing around with Containers on Windows Server 2016 GA. I can’t say I’m enthralled with Docker being the default interface for Containers now, but I understand Microsoft’s 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 have been easy. But dragging open source onto Windows causes issues …. they do things inconsistently and all the docs are for Linux. Grep! Really!?!?

Eventually I found 1 variation of a solution that worked. The first line stops all running containers:

The second line removes all running containers:

Please follow and like us:

Leave a comment

Your email address will not be published.

*