Skip to content

Instantly share code, notes, and snippets.

@kb05
Last active October 6, 2019 18:05
Show Gist options
  • Save kb05/bcb7ac945d92c26e9028eb71a6f4d589 to your computer and use it in GitHub Desktop.
Save kb05/bcb7ac945d92c26e9028eb71a6f4d589 to your computer and use it in GitHub Desktop.
StopAllDocker
#!/bin/bash
sudo docker ps | cut -f 1 -d " " |tail -n +2 | xargs sudo docker stop
#sudo docker ps Get running docker containers
#Select only the id
#Ignore the first line ("Container")
#Pass to stop command each container
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment