dotfiles/config/scripts/docker-image-childs

12 lines
248 B
Bash
Executable File

#!/usr/bin/env sh
# Find the dependent child image from an image
parent="$1"
# From https://stackoverflow.com/a/41634462
for i in $(docker images -q)
do
docker history "$i" | grep -q "$parent" && echo "$i"
done | grep -v "$parent" | sort -u