Idea ID: 2751033

Docker registry uses too much disk space due to old images

Status : Waiting for Votes
over 1 year ago

We would like to have the possibility of cleanup process that automatically deletes all old image versions that are no longer used.

The business case is as follows:

In an environment that has been upgraded through many versions the docker registry consumes a lot of excess disk space because of old image versions. The normal cleanup scripts only delete images that are no longer used at all with the same name. For all images still in use all old versions (tags) are still stored in the registry consuming disk space.


Using the script cleanRegistry to delete named images is not really helpful as it will also delete the newest version that is still in use. And even if it did work, using it would require a lot of manual work identifying all images and their tags that can be deleted.

Several outdated image versions in the docker registry. In the management portal under Administration -> Local registry the images currently active in the system are shown. By clicking the tags-link after the image names we can see that most images have contain multiple tags and while the old ones are not used anymore, they still consume space in the registry.
This seems related to QCIME156573.
It seems that a complete solution for this behavior does not yet exist, a registry does not have information on what images are being used in hosts and therefore the concept of unused images is problematic from the registry perspective.
Possible Workaround:
Remove all images from the registry and then re-add the active ones.