Skip to content

Instantly share code, notes, and snippets.

@evanscottgray
Last active November 7, 2023 03:40
Show Gist options
  • Save evanscottgray/8571828 to your computer and use it in GitHub Desktop.
Save evanscottgray/8571828 to your computer and use it in GitHub Desktop.
kill all docker containers at once...
docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt
@sorenwacker
Copy link

Why not something like docker stopall ?

@mjrdnk
Copy link

mjrdnk commented Oct 17, 2022

docker kill $(sudo docker ps -q)

This is great, thanks @webdev23 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment