« Back to Index

[Docker Cleanup Remove Prune]

View original Gist on GitHub

Tags: #docker #remove #cleanup #prune

Docker Cleanup Remove Prune.bash

# the following command is a 'scorched earth' approach and could make the other commands redundant
docker system prune -a

# stop and Remove all containers
alias drf='docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q)'

# remove all images
dri() { docker rmi -f $(docker images -q); }

# remove all <none> images
drn() { docker rmi -f $(docker images --filter "dangling=true" -q); }