Created
August 18, 2020 03:59
-
-
Save darrensapalo/147b876cccdc7b32aa590e2cb5e11672 to your computer and use it in GitHub Desktop.
Clean up docker images with <none>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
IMAGE_IDS=$(docker image ls | grep '<none>' | sed -r 's/.*([a-f0-9]{12}).*/\1/g') | |
echo "Deleting $IMAGE_IDS" | |
docker image rm $IMAGE_IDS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Depends on
jq
- See https://stedolan.github.io/jq/manual/