How do you specify the number of images to keep in the harbor?
In Harbor, you can specify the number of images to be retained by setting image retention policies. These policies can be set at the repository or namespace level.
- Warehouse level configuration: You can specify the number of image retentions in the settings of each warehouse. Simply choose a specific warehouse in Harbor’s web interface and click on the “Settings” tab. In the “Retention Policy” section, you can set the number of images to retain.
- Namespace level configuration: You can specify the number of reserved images in the namespace settings. In the Harbor web interface, select a specific namespace and then click on the “Settings” tab. Within the “Retention Policy” section, you can set the number of reserved images.
In these two levels of settings, you can choose to keep the latest N images or keep all images.
Note: The setting for retaining the number of image copies only applies at the repository or namespace level. If a replication policy is used in Harbor, the number of images copied to other Harbor instances is controlled by the replication policy, not the retention policy settings.