Created
September 20, 2019 07:59
-
-
Save balda/57d31216d9ef3481226b54080e1b37fa to your computer and use it in GitHub Desktop.
Get docker child images
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/bash | |
check() | |
{ | |
if [ "$1" = "" ]; then | |
echo "Need a docker ID in argument"; | |
exit; | |
fi | |
} | |
check $1 | |
DOCKER_ID=$1 | |
for i in $(docker images -q) | |
do | |
docker history $i | grep -q $DOCKER_ID && docker images | grep $i | |
done | sort -u |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment