Skip to content

Instantly share code, notes, and snippets.

@wakumaku
Last active September 27, 2017 14:36
Show Gist options
  • Save wakumaku/143a2e8c2931dff61bcf461f562ca5a3 to your computer and use it in GitHub Desktop.
Save wakumaku/143a2e8c2931dff61bcf461f562ca5a3 to your computer and use it in GitHub Desktop.
delete all docker containers and images
#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# docker rm $(docker ps --filter=status=exited --filter=status=created -q)
# Delete all images
docker rmi $(docker images -q)
# Delete untagged images
# docker rmi $(docker images -f "dangling=true" -q)
# Delete all volumes
docker volume rm $(docker volume ls -f dangling=true -q)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment