Skip to content

Instantly share code, notes, and snippets.

@DieselTech
Created October 15, 2017 02:42
Show Gist options
  • Save DieselTech/20d810a31e1b0e60529a2b22a1040259 to your computer and use it in GitHub Desktop.
Save DieselTech/20d810a31e1b0e60529a2b22a1040259 to your computer and use it in GitHub Desktop.
Cleanup Docker
List all containers (only IDs)
docker ps -aq
Stop all running containers
docker stop $(docker ps -aq)
Remove all containers
docker rm $(docker ps -aq)
Remove all images
docker rmi $(docker images -q)
Mass cleanup of everything
docker system prune -a
WARNING! 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 images without at least one container associated to them
Are you sure you want to continue? [y/N]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment