9951 explained code solutions for 126 technologies

dockerHow to find dependent child images in docker

PARENT=ba6acccedd29; docker inspect --format='"{{.Id}}" : "{{.Parent}}"' $(docker images --filter "since=$PARENT" --quiet)  | grep $PARENTctrl + c

declare PARENT variable


id of the image to get child images for

docker inspect

gets detailed information about an image


return formatted data

"{{.Id}}" : "{{.Parent}}"

we will see "child-id" : "parent-id" lines

docker images

list docker images


filter images list


show only those images which were created after parent image

grep $PARENT

finally, filter output to see only children of the specified parent