You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
453 B
16 lines
453 B
6 years ago
|
#!/bin/bash
|
||
|
|
||
|
# Usage example:
|
||
|
# docker-inheritance ~/git ~/docker ~/svn -name ca -prune -o -name node_modules -prune -o -name suisseid3 -prune -o | dot -Tpng > /tmp/inheritance.png; gwenview /tmp/inheritance.png
|
||
|
|
||
|
(
|
||
|
echo "digraph G {"
|
||
|
for df in $(find $* -name 'Dockerfile' -print); do
|
||
|
p=${df%/Dockerfile}
|
||
|
n=mwaeckerlin/${p##*/}
|
||
|
sed -n 's,^FROM *\([^:]*\).*,"\1" -> "'"$n"'",gp' $df
|
||
|
done | sort | uniq
|
||
|
echo "}"
|
||
|
)
|
||
|
|