I have rootless docker version (20.10.2) installed on one of the Linux machine which we are using as an agent to build docker image from Jenkins pipeline. After pushing the images , as part of cleanup I am deleting those local images from this machine as well as running system prune command as well periodically. With all that cleanup , I can still see dead containers inside my vfs directory which are taking lots of space inside docker root directory. Do we have a way to remove those dead containers apart from going inside vfs and execute rm command ? The ownership of these containers turned directories are with some other user which we have mentioned inside Dockerfile so it is going to be difficult to delete them even with rm command unless we use root user. So looking for help to clean up those dead/orphaned containers/directories.
After some research , I found that it is caching our custom base images inside vfs/dir directory and occupying lot of space with them. It is surprising that system prune is not removing them. Do we have a way to address this space leak issue with custom base images.