Created
February 25, 2018 20:32
-
-
Save ronanguilloux/181a9e0a9e18516b3005e72f3d4aeac2 to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/bash | |
# disk-usage from docker-experiments | |
# https://github.com/rsp/docker-experiments | |
# by Rafał Pocztarski - https://github.com/rsp | |
if [ $# -ne 1 ]; then | |
echo "Usage: $0 \"image1 image2 ...\"" | |
exit 1 | |
fi | |
images="$1" | |
echo "docker-experiments/disk-usage - data from `date -I`" | |
echo "See: https://github.com/rsp/docker-experiments" | |
echo -e "Image\tDisk usage" | |
echo -e "-----\t----------" | |
for image in $images; do | |
echo -ne "$image\t" | |
docker run --entrypoint=/bin/sh $image -c \ | |
'du -sh / 2>/dev/null | cut -f1' \ | |
|| echo "ERROR!" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment