Hey everyone! We're in the process of setting up a private Docker registry for our company, and one of the top features we need is automatic housekeeping. We want to ensure that old and unused images are automatically deleted to help manage our disk space effectively.
Since we use Jenkins for our CI/CD, we push images pretty frequently, which means our registry tends to get cluttered with outdated builds and untagged layers over time. Here's what we're looking for in a solution:
- Scheduled or on-demand cleanup tasks
- Support for retention policies (like keeping the last N images or removing images older than a certain number of days)
- Ideally, a web UI and/or API for managing images
- Smooth integration with Jenkins without causing issues
Currently, we're checking out Harbor and Nexus but are open to other suggestions. What are you using in production for this setup? Any pros or cons we should be aware of? Thanks!
4 Answers
Nexus 3 has decent support for Docker images, and you can schedule cleanup tasks with its free tier. If you go for the enterprise version, it’s a bit pricey since they charge based on the number of users (minimum 30 for about $5000).
JFrog Artifactory is nice too, but I can't remember if the free version supports Docker images. The paid options can get really expensive, especially with their cloud version since they charge for storage and transfer. If you're using AWS, ECR is a good option – it has some quirks, like holding only one image per repo, but overall it's pretty solid if your images are stable.
I'm a fan of Harbor. The setup can be a bit tedious if it's not running natively in Kubernetes, but once it's up, it has excellent features. The pull-through cache is super helpful for avoiding API limits too!
True, but keep in mind that Harbor only supports OCI images, which might lead to needing multiple registries for different package formats.
If you're willing to spend some cash, Artifactory has cleanup policies available in their Enterprise+ plan. We use it without that and rely on a GitHub tool for NPM cleanup along with a custom batch script for Docker images, since that tool doesn’t handle multi-arch images.
Also, it has a solid API and you can use server-side scripts for more complex cleanup tasks.