Skip to content

Instantly share code, notes, and snippets.

@balda
Created September 20, 2019 07:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save balda/57d31216d9ef3481226b54080e1b37fa to your computer and use it in GitHub Desktop.
Save balda/57d31216d9ef3481226b54080e1b37fa to your computer and use it in GitHub Desktop.
Get docker child images
#!/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