Skip to content

Instantly share code, notes, and snippets.

@yowcow
Created June 29, 2018 01:07
Show Gist options
  • Save yowcow/6b1b3cc31d0a373d88a3614d8079dcfe to your computer and use it in GitHub Desktop.
Save yowcow/6b1b3cc31d0a373d88a3614d8079dcfe to your computer and use it in GitHub Desktop.
List dangling docker images
#!/bin/sh
# List dangling images
docker images --filter dangling=true
# List dangling image IDs
docker images --filter dangling=true | awk 'NR > 1 { print $3 }'
# Remove all dangling images
docker images --filter dangling=true | awk 'NR > 1 { print $3 }' | xargs docker rmi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment