Skip to content

Instantly share code, notes, and snippets.

@sharepointoscar
Last active January 28, 2020 01:34
Show Gist options
  • Save sharepointoscar/8f4b503537bdf794e221642f9c03b605 to your computer and use it in GitHub Desktop.
Save sharepointoscar/8f4b503537bdf794e221642f9c03b605 to your computer and use it in GitHub Desktop.
Removes all dangling Docker images
# delete docker images that are dangling
docker rmi $(docker images -f "dangling=true" -q ) --force
# delete images with the status 'exited'
docker rmi $(docker ps --all -f "status=exited" -q)
# A nice holistic cleanup approach named: Scorched Earth Cleanup.
# Kindly provided by James Todd (https://twitter.com/jwtodd)
alias drc='docker rm $(docker ps -a -q)'
alias dri='docker rmi $(docker images -a -q)'
alias drv='docker volume prune -f'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment