Skip to content

Instantly share code, notes, and snippets.

@your
Last active July 20, 2017 15:44
Show Gist options
  • Save your/59a7e13bdc5be7044d169da2c7c3f35d to your computer and use it in GitHub Desktop.
Save your/59a7e13bdc5be7044d169da2c7c3f35d to your computer and use it in GitHub Desktop.
#!/bin/bash
# Docker cleanup utility.
# Stop all containers
docker kill $(docker ps -q)
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi -f $(docker images -q)
# Delete all dangling volumes
docker volume rm $(docker volume ls -qf dangling=true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment