Skip to content

Instantly share code, notes, and snippets.

@runlevel5
Created June 19, 2014 03:59
Show Gist options
  • Save runlevel5/53c6deb22a2bc04e93f8 to your computer and use it in GitHub Desktop.
Save runlevel5/53c6deb22a2bc04e93f8 to your computer and use it in GitHub Desktop.
Destroy untagged docker images
#!/bin/bash
IMAGE_IDS=$(docker images | grep "^<none>" | awk "{print $3}")
if [ -n "$IMAGE_IDS" ]; then
docker rmi $IMAGE_IDS > /dev/null 2>&1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment