Skip to content

Instantly share code, notes, and snippets.

@o-az
Created October 28, 2022 03:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save o-az/295699a66ad74b7e05d5ba2096cea8e0 to your computer and use it in GitHub Desktop.
Save o-az/295699a66ad74b7e05d5ba2096cea8e0 to your computer and use it in GitHub Desktop.
This will delete all containers, images, and volumes
#!/bin/sh
# Run with: bash docker-delete-everything.sh
# Stop all containers
docker stop $(docker ps --all --quiet)
# Delete all containers
docker rm $(docker ps --all --quiet)
# Delete all images
docker rmi $(docker images --quiet)
# Delete all volumes
docker volume rm $(docker volume ls --quiet)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment