How to clean up old images in docker registry with jenkins
We have a script which we run periodicaly which scans our docker registry for orphaned items, and then deletes them.

Unfortunately, it requires multiple API calls to get all the data required, and then to delete each image.  But basically, if an image hash is lacking a 'latest' tag or a tag that starts with 'v' it gets culled.

You could probably also try deleting based on last modified date.

We run this as a cron job in kubernetes, but you could just as easily run a script like this as a periodic jenkins job.