Cleanup policy (docker) for all non-version images


we generate various docker images during development and push them to CI. They are usually short lived and used for a few days max. Final and production images always have the same tags in format - (eg apache:1.2.3).

I’m trying to create a clean policy, that keeps production images, but delete all other like:

As regex is pretty basic is Nexus, is there a good and simple way to keep production images and delete all other?

Anyone has any ideas?

  1. Use multiple repositories, e.g. in Maven land you would have a snapshots repo and a releases repo.
  2. Use a common naming scheme so you can use regex
  3. If you’re a Pro user you could use tagging

We had some internal debate and using common naming scheme would probably be the fastest way to achieve what we want. A scheme that is compatible with reduced regex in Nexus.