Last active
August 29, 2015 14:16
-
-
Save jstangroome/0d8732900a08c001ea76 to your computer and use it in GitHub Desktop.
Compare the list of files changed in two docker images with file sizes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo docker run --rm imagebase /usr/bin/find / -printf '%s\t%p\n' | sort -k2 >/tmp/imagebase | |
sudo docker run --rm imagenext /usr/bin/find / -printf '%s\t%p\n' | sort -k2 >/tmp/imagenext | |
# list removed files by size | |
diff -u /tmp/imagebase /tmp/imagenext | grep '^-' | cut -c 2- | sort -n | |
# list added files by size | |
diff -u /tmp/imagebase /tmp/imagenext | grep '^+' | cut -c 2- | sort -n | |
# list removals and adds by size | |
diff -u /tmp/imagebase /tmp/imagenext | grep '^[-+]' | sort -n -k1.2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment