Last active
April 5, 2024 17:35
-
-
Save OhadRubin/9819f29ff124bade0ec9433cde1da5c7 to your computer and use it in GitHub Desktop.
docker how much space
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
sudo ncdu / | |
sudo docker container ls -a --format '{{.ID}}:{{.Names}}' | xargs -I {} sh -c 'echo "Container {} ($(echo {} | cut -d: -f2)): $(sudo docker inspect --format "{{.GraphDriver.Data.MergedDir}}" $(echo {} | cut -d: -f1) | sed "s/\/merged$//") (Size: $(sudo du -sh $(sudo docker inspect --format "{{.GraphDriver.Data.MergedDir}}" $(echo {} | cut -d: -f1) | sed "s/\/merged$//") | cut -f1))"' | |
sudo docker image ls --format '{{.ID}}:{{.Repository}}:{{.Tag}}' | xargs -I {} sh -c 'echo "Image {} ($(echo {} | cut -d: -f2):$(echo {} | cut -d: -f3)): $(sudo docker inspect --format "{{.GraphDriver.Data.UpperDir}}" $(echo {} | cut -d: -f1) | sed "s/\/diff$//") (Size: $(sudo du -sh $(sudo docker inspect --format "{{.GraphDriver.Data.UpperDir}}" $(echo {} | cut -d: -f1) | sed "s/\/diff$//") | cut -f1))"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment