Are there any best practices for artifact management (cleaning up Docker Hub or JFrog repository)

Viewed 31

I'm trying to create an artifact retention policy in my team's dockerhub and JFrog repositories. Are there any standardized methods or best practices that have been published on this topic?

A few things that I believe would be a good starting point:

  1. Retain any images that are currently deployed in kubernetes (high priority)
  2. Retain any images based on recent activity (i.e. all images pushed or pulled in the last 30 days, 60 days, etc.)
  3. Retain images based on specific versions/tags/releases of application

Any resources on this topic would be much appreciated.

1 Answers

If you are maintaining a separate repository in Artifactory to maintain such images, those images would persists in the remote repository's cache. The same logic applies for the second query as well. Reference: Artifactory-remote caching mechanism, the setting called Metadata Retrieval Cache Period in the remote repositories plays a vital role here.

For the maintenance of images that are being utilised for a specific period of time and cleanup the rest, AQL [Artifactory Query Language] can be used and an example has been shared in the blog by Angello, Cleaning up the Artifacts and Docker Images.

Additional References: https://jfrog.com/knowledge-base/how-to-clean-up-old-docker-images/ https://jfrog.com/knowledge-base/artifactory-cleanup-best-practices/

Related