Browse Source

don't forget to cleanup the volumes…

master
Marc Wäckerlin 3 years ago
parent
commit
882d295f27
  1. 15
      docker-inheritance
  2. 2
      docker-prune

15
docker-inheritance

@ -0,0 +1,15 @@
#!/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 "}"
)

2
docker-prune

@ -129,8 +129,10 @@ trap 'traperror "$? ${PIPESTATUS[@]}" $LINENO $BASH_LINENO "$BASH_COMMAND" "${FU
if test -z "$filter"; then
run docker container prune -f
run docker volume prune -f
run docker image prune -a -f
else
run docker container prune -f --filter "$filter"
run docker volume prune -f
run docker image prune -a -f --filter "$filter"
fi

Loading…
Cancel
Save