Skip to content

Instantly share code, notes, and snippets.

@chothia
Forked from JeffBelback/docker-destroy-all.sh
Created May 23, 2016 22:17
Show Gist options
  • Save chothia/9691b63fa4de378656ceb7d292a87a87 to your computer and use it in GitHub Desktop.
Save chothia/9691b63fa4de378656ceb7d292a87a87 to your computer and use it in GitHub Desktop.
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
docker stop $(docker ps -a -q)
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment