Docker: How to remove all manifests without any tags assigned (with groovy or tasks)?

Sonatype Nexus Repository
COMMUNITY 3.77.2-02

I am trying to remove all manifests and their related blobs, that have no docker tag assigned. I.e. when I delete a tag in the browse UI, I would like to remove it’s associated manifest too.

I tried using groovy scripts for that, but there seems to be no documentation or even working examples for listing manifests or blobs when using SQL database. All I found seems to be using OrientDB, but these do not work using SQL.

Also, pages that supposedly explained the differences are down: https://help.sonatype.com/en/feature-availability-for-postgresql-and-h2-databases.html

So, how do I iterate over all manifests and check if they have any tags assigned and remove the ones without tags?

Can anyone provide working groovy script (not with orientDB but with postgreSQL), that just lists all docker manifests and their properties to get me started?

Thanks a lot!

You should be able to use the task Docker - Delete unused manifests and images.

https://help.sonatype.com/en/cleanup-policies.html#docker-cleanup-strategies

Hey Lukáš,
I see Matthew provided a link to the appropriate task to use; I just wanted to address the missing help page you linked.

We removed that page after Postgres and H2 became our only databases. You can find a lot of that same information here:
https://help.sonatype.com/en/database-options.html

And this is a good spot to look in as well just for Postgres/H2 requirements: Sonatype Nexus Repository System Requirements

I checked both of your links and cannot find any information about supported functions/methods in groovy scripts for the Postgres deployment type. No example, no nothing.

Is there any groovy scripting documentation available for the Postgres deployment type?

Thanks a lot, that worked flawlessly (after also rebuilding the browse and search indexes)