I have a concept to understand here to solve a problem I am facing with my docker containers and the disk usage by them.
When I dig into the overlay directory of a container, (for example in /var/lib/docker/overlay2/0ec5c07ba6ae1692ad127173/diff/home/bamboo/.m2/repository) I see a lot of files that are unnecessary consuming the disk space ~200G and I want to understand why these files are still here in this directory.
I am assuming that this has something to do with the docker top most writable layer concept to keep track of the changes. But I want to know if these files are supposed to be deleted by Docker at any point? If not, can we just delete them without impacting the containers?
I have already tried Docker prune
command trying to delete these files with no luck!
I would appreciate it if someone could share some light on this to help me understand the concept and solve my problem.
Thanks in advance!