
Continuous integration pipelines build and push container images and language packages after every commit. Without automated retention rules, repositories store every artifact version forever. Setting up an Artifact Registry cleanup workflow removes obsolete builds while protecting the versions your workloads actually run. However, deleting artifacts blindly can break production rollbacks or active deployments. Therefore, your team needs a safe, three-step process to identify active dependencies, test retention rules in dry-run mode, and verify storage charges in your billing data.
Key takeaways
- Google Cloud includes 0.5 GiB of free Artifact Registry storage per billing account each month, and charges $0.10 per GiB-month after that.
- Follow a 3-step cleanup process: map deployment references, test rules in dry-run mode before activation, and check subsequent billing exports.
- Billing data shows total repository bytes and project spend, but it cannot prove whether a running workload still needs a specific artifact version.
How Artifact Registry storage is billed
According to Google Cloud Artifact Registry pricing, each billing account gets 0.5 GiB of free storage per month. Above that threshold, standard and remote repositories cost $0.10 per GiB-month. Google calculates this charge hourly at $0.000136986 per GiB-hour across all projects linked to your billing account.
For Docker images, you only pay for unique image layers. If ten image versions share a base OS layer, you pay to store that base layer once. However, compiled application layers change with every commit. As a result, unique bytes accumulate every time your CI pipeline pushes a new build.
You can track these charges in the Google Cloud Billing export to BigQuery. Specifically, filter by the Artifact Registry service description to see project-level spend. In addition, run gcloud artifacts repositories list to check the exact billed byte size of each repository in a project.
Repositories with no cleanup policy
By default, new Artifact Registry repositories do not have retention rules. They keep every container image, Maven package, npm module, or Python wheel pushed to them. Over time, a repository with no active cleanup policy grows continuously and drives up project Artifact Registry spend.
When you inspect the Google Cloud console or CLI metrics, you might find a repository holding huge byte volumes without any lifecycle controls. However, raw storage volume and project spend only highlight the problem. Billing exports and repository byte metrics cannot tell you which versions are safe to delete. For example, an image built six months ago looks identical on the bill to an image built yesterday. Therefore, you must investigate workload dependencies before removing anything.
Find the versions deployments still reference
Never delete artifacts or apply retention rules before verifying ownership, active dependencies, and recovery needs. If you remove an image digest that a cluster still references, node scale-ups and pod restarts will fail with ImagePullBackOff errors.

First, identify the team that owns the repository and its deployment pipelines. Next, inspect your running environments to see which versions are currently active. Check your Google Kubernetes Engine (GKE) manifests, Cloud Run revisions, Compute Engine instance templates, and Helm charts. Record both the tags and the immutable SHA-256 digests in use.
Furthermore, ask the application owners about their rollback and recovery requirements. Some services need the last five release versions ready for instant rollback. Other workloads rely on a specific base image that rarely receives updates. Age alone is a dangerous deletion signal. An untouched base image from last year might still support every production service today. Anything without a clear owner or deployment record requires further investigation before you touch it.
Set up Artifact Registry cleanup policies in dry-run, then activate
Once you know which versions your deployments need, you can translate those rules into an Artifact Registry cleanup policy. Google Cloud supports two policy actions: Delete and Keep.
A Delete rule marks artifacts for removal based on tag state (TAGGED, UNTAGGED, or ANY), tag prefixes, and age (olderThan). Conversely, a Keep rule protects matching artifacts from deletion. It can match specific tag prefixes or retain a fixed number of recent versions (keepCount). According to the Google Cloud cleanup policy overview, Keep rules always override Delete rules when an artifact matches both.
Test rules in dry-run mode first
Do not activate a deletion policy immediately. Instead, follow the official cleanup configuration guide and enable dry-run mode first. You can apply a policy JSON file using the CLI flag --dry-run with gcloud artifacts repositories set-cleanup-policies.
In dry-run mode, Artifact Registry evaluates your rules against the repository during its next scheduled cycle, which typically runs within a day. It does not delete any files. Instead, it writes audit events to Cloud Logging showing which versions would have been removed. Review these logs carefully with the repository owners. Verify that active production tags, rollback versions, and base images are not flagged for removal. After you confirm the dry-run output matches your recovery needs, update the repository to make the policy active.
Check later billing for repository storage
Activating a policy does not reduce your storage metrics at that exact second. Artifact Registry runs cleanup tasks asynchronously in the background. Furthermore, because container registries deduplicate shared layers, deleting an old image tag only reduces stored bytes if no remaining images reference those layers.

Wait a few days after activation, then check your Google Cloud Billing export and repository size metrics again. Compare the new repository byte count and daily project Artifact Registry spend against your baseline before the policy ran. If the byte count does not drop as expected, check Cloud Audit Logs for BatchDeleteVersions calls. In addition, verify whether repository tag immutability or parent multi-arch manifests are blocking version removal.
How Binadox helps monitor Artifact Registry storage costs
Binadox is a cloud cost visibility and optimization tool. To help you catch unmanaged artifact growth across your projects, Binadox flags when a specific Artifact Registry repository—identifying its name, format, and project ID—has no active cleanup policy. In addition, it reports the exact byte volume the repository holds alongside the project’s overall Artifact Registry spend, prompting your team to add a retention policy that keeps only the versions deployments need.

Conclusion
Keeping every build from every commit is an expensive way to run a package archive. Yet treating repository cleanup as a blind purge is much worse, unless your team enjoys broken rollbacks on a Friday afternoon. By checking active deployment references first, testing your Artifact Registry cleanup rules in dry-run mode, and verifying the resulting storage charges in your billing data, you keep your pipelines reliable and your storage footprint under control.
To catch unmanaged repositories across your infrastructure before storage fees scale up, you can start your free Binadox trial or book a demo to see automated optimization in action.