Skip to content

Instantly share code, notes, and snippets.

@wdmtech
Created April 4, 2018 17:53
Show Gist options
  • Save wdmtech/f5fd27d9152f07da2295f7f639e58006 to your computer and use it in GitHub Desktop.
Save wdmtech/f5fd27d9152f07da2295f7f639e58006 to your computer and use it in GitHub Desktop.
How to remove all the crud Docker leaves behind
### To remove all containers
docker rm -f $(docker ps -aq)
### To remove all volumes
docker volume rm $(docker volume ls -q)
### To remove all images
docker rmi -f $(docker images -a -q)
### Combined above 3 commands
docker rm -f $(docker ps -aq); docker volume rm $(docker volume ls -q); docker rmi -f $(docker images -a -q)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment