Quick command to stop all docker container

These are the commands to use when you want to stop all your docker containers.

On MacOS/Linux:

docker stop $(docker ps -a -q)

For Windows:

FOR /f "tokens=*" %i IN ('docker ps -a -q') DO docker rm %i

Sources:

  • https://coderwall.com/p/ewk0mq/stop-remove-all-docker-containers
  • https://gist.github.com/ngpestelos/4fc2e31e19f86b9cf10b