Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Docker cleanup
# Remove exited containers
docker rm $(docker ps -qa --no-trunc --filter "status=exited")
# Remove dangling containers
docker rmi $(docker images --filter "dangling=true" -q --no-trunc)
# Remove unused images (
docker rmi $(grep -xvf <(docker ps -a --format '{{.Image}}') <(docker images | tail -n +2 | grep -v '<none>' | awk '{ print $1":"$2 }'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.