Skip to content

Instantly share code, notes, and snippets.

@amandoabreu
Created March 4, 2019 16:36
Show Gist options
  • Save amandoabreu/30560cab9156fb935a9fcd5e3a486620 to your computer and use it in GitHub Desktop.
Save amandoabreu/30560cab9156fb935a9fcd5e3a486620 to your computer and use it in GitHub Desktop.
Nuke docker containers, volumes, and all
$ docker system prune
This will remove:
- all stopped containers
- all volumes not used by at least one container
- all networks not used by at least one container
- all dangling images
As below, this is nuclear.
To clean your system, first remove containers
$ docker rm $(docker ps -aq)
then remove images
$ docker rmi $(docker images -q)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment