Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Stop / remove all Docker containers

Stop all Docker containers

docker stop $(docker ps -a -q)

Remove not running all containers

docker ps -a | grep 'weeks ago' | awk '{print $1}' | xargs --no-run-if-empty docker rm

Delete all Volume

docker volume rm $(docker volume ls -qf dangling=true)

Delete all containers

docker rm $(docker ps -a -q)

Delete all images

docker rmi $(docker images -q)

Clean docker used space.

sudo service docker stop && sudo rm -rf /var/lib/docker && sudo service docker stop && sudo service docker start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.