Skip to content

Clean up unused images

View as Markdown

Image Cleanup removes every untagged image from every repository in a registry project, and keeps every tagged image. An image loses its tag when you push another image with the same tag, so a project that you push to often gathers untagged images. Run cleanup on a schedule, or when you choose.

This works on a registry project that reads Created. If you are a team member, you also need a role with the update and delete permissions for Container Registry. See Create a registry project. To keep an image, keep a tag on it: cleanup always protects tagged images.

In MyAccount, under Storage, click Container Registry, click your project, and open its Image Cleanup tab.

Under Auto-Cleanup Schedule, choose a Schedule, and click Save Schedule:

  • Off: cleanup runs only when you start it. A new project starts at Off.
  • Daily: cleanup runs at 00:00 UTC every day. Choose this for a project you push to every day, such as one a build system pushes to.
  • Weekly: cleanup runs at 00:00 UTC every Sunday. Choose this for a project you push to now and then.

Under the schedule, Last Execution and Last Manual Execution show when cleanup last ran, or Never.

  1. Under Manual Cleanup, click Dry Run. Simulate Cleanup opens.
  2. Click Run Simulation. Cleanup records what it would remove, and deletes nothing.

The dry run appears in Execution History as its own row, with Status Success, Trigger MANUAL, and Dry Run Yes. Click the row to see each repository’s Status, Total Processed, and Retained.

Deleting untagged images cannot be undone. Run a dry run first to see what goes.

  1. Under Manual Cleanup, click Delete Untagged Images. Confirm Image Cleanup opens and says This action cannot be undone.
  2. Click Delete.

The run appears in Execution History, and Last Manual Execution shows when it ran.

Execution History lists each run with its ID, Status, Trigger, Dry Run, Start Time, and End Time. The schedule runs at 00:00 UTC, and Start Time and End Time show in your local time, so a scheduled run in India starts at about 5:30 AM. Click a run to see each repository’s Status, Total Processed, and Retained. With no runs yet, the list says No cleanup executions yet.

Your project now keeps only the images you tagged. Storage Used on the Image Cleanup tab goes down right away. Each month is billed on its peak, so the next month’s bill starts from the smaller size. To remove a tagged image or a whole repository, see Delete a project, repository, or artifact.