Last active
December 5, 2017 10:06
-
-
Save rkusa/113ec00b80c33fff9d91 to your computer and use it in GitHub Desktop.
list Docker volumes/mounts sizes
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
#!bash | |
for id in `docker ps -q`; do \ | |
name=`docker inspect -f {{.Name}} $id | tail -c +2`; \ | |
echo "$name ($id)"; \ | |
mounts=(`docker inspect -f '{{range .Mounts}}{{.Source}} {{end}}' $id`); \ | |
for mount in ${mounts[@]}; do \ | |
du -hLs $mount | tail -n 1; \ | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This one suppresses all the permission denied errors.