Skip to content

Commit

Permalink
Add an optional IGNORE_FILESIZE flag
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Feb 24, 2016
1 parent 9c4e7fa commit 705abf8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docker-diff
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ IMAGE_B=$2

container_a=$(docker create "$IMAGE_A" /dontexist)
container_b=$(docker create "$IMAGE_B" /dontexist)
AWK='{printf "%-10s %-10s %-100s\n",$1,$3,$6}'
if [ "$IGNORE_FILESIZE" = "1" ]; then
AWK='{printf "%-10s %-100s\n",$1,$6}'
else
AWK='{printf "%-10s %-10s %-100s\n",$1,$3,$6}'
fi

diff <(docker export "$container_a" | docker run -i --rm ubuntu tar tvf - | awk "$AWK") <(docker export "$container_b" | docker run -i --rm ubuntu tar tvf - | awk "$AWK")

Expand Down

0 comments on commit 705abf8

Please sign in to comment.