DWQA QuestionsCategory: Development ToolHow do you understand Docker's growing file size?
Question leaf asked 4 weeks ago

There is not enough disk space on VPS. After checking the files, we found that there are many files, especially some files in the Docker installation directory are very large. How to understand the files. Docker-related files can be reduced?

➤➤ sudo find / -xdev -type f -size +100M
/swapfile
/var/log/nginx/access.log
/var/lib/docker/containers/998d354cfc70b7c25669f9bbc2a8bf8a663d36f4a4c20946f630d5e4161a7e76/998d354cfc70b7c25669f9bbc2a8bf8a663d36f4a4c20946f630d5e4161a7e76-json.log
/var/lib/docker/aufs/diff/93bfdb4fbb87c00b899bd7685a0b32f53fd52b0e6deb370a819375d12c209c09/var/www/discourse/.git/objects/pack/pack-a04998dcdce7676932a4768d1c3e2076b27bd30b.pack
/var/lib/docker/aufs/diff/d69c7fe24577873cea0c49f8c88a243f4c05fde3054b0057baa72f3bc5056698/var/www/discourse/.git/objects/pack/pack-a04998dcdce7676932a4768d1c3e2076b27bd30b.pack
3 Answers
Good Rain Technology answered 4 weeks ago

Try cleaning up the logs in the mirror where docker runs, and maybe some space can be cleared out.

Question leaf replied 4 weeks ago

So, I’m going to go inside the docker container to check and understand.

Junior answered 4 weeks ago

Try this: Shellscript to delete orphaned docker volumeshttps://registry.hub.docker.com/u/martin/docker-cleanup-volumes/

The gang leader Big Brother answered 4 weeks ago

When you execute remove, you don’t remove the cached files that docker pulls down. The more you pull, the larger the files will become until the disk is full.