Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jalexanderfox/888f266e78e4ff54134d to your computer and use it in GitHub Desktop.
Save jalexanderfox/888f266e78e4ff54134d to your computer and use it in GitHub Desktop.
Stop all running docker containers, then delete them all including their images (useful for when a containers get corrupted and an automated process pulls the latest)
#!/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