Artifact Registry in Google Cloud: The Secure Warehouse for Your Container Images and Software Packages
A complete, plain-English guide to Artifact Registry: how repositories, formats, remote and virtual repositories, IAM, vulnerability scanning, cleanup policies and CI/CD integrations work together to store, protect and deliver the building blocks of your software.
Imagine a large factory that builds cars. Parts arrive from many suppliers: engines, tires, seats, screws. The factory does not leave these parts lying around in random corners. It keeps them in a well-organized, locked warehouse where every part is labeled, counted, inspected and handed out only to people who are allowed to take them. If a supplier delivers a faulty batch, the warehouse can tell you exactly which cars received it. Software works the same way. Modern applications are built from container images, libraries and packages, and these pieces need a trustworthy warehouse. Artifact Registry is that warehouse on Google Cloud. In this guide we start from the first idea and build up to the choices that keep a software supply chain fast, organized and safe.
1What Is Artifact Registry?
Before looking at features, let us understand what an “artifact” is and why it needs a registry.
What is an artifact?
An artifact is any file or bundle produced or used while building and running software. Examples include a container image that holds an application and everything it needs to run, a Java library packaged as a jar file, a JavaScript package, a Python package, or a Helm chart that describes how to install an application on Kubernetes. Artifacts are the finished parts that get passed from one stage of software delivery to the next.
The one-sentence definition
Artifact Registry is Google Cloud’s fully managed service for storing, managing and securing container images and language packages. It gives your teams a single place to keep these artifacts, control who can use them, scan them for known weaknesses and deliver them quickly to the systems that run your applications.
Think of a public library with a very strict librarian. Each book (artifact) has a catalog number and a version. Some shelves are open to everyone, some are restricted to staff, and the librarian checks every returned book for damage. Artifact Registry is the library, and the librarian is the set of permissions, scans and rules around it.
The problem it solves
Without a central registry, teams store images and packages in scattered places: personal laptops, shared drives, public websites or separate tools for each language. This makes it hard to know what is in production, who can change it, or whether a package has been tampered with. A central, access-controlled, scanned registry brings order and safety.
Artifact Registry is the successor to Container Registry, Google’s older image storage service. Container Registry has been retired in favor of Artifact Registry, and older gcr.io addresses are supported through Artifact Registry. Always check current documentation for migration details and supported formats.
2Why Artifact Registry Exists
Understanding where it came from explains why it supports so many formats and so many security features.
Google’s first image storage service, Container Registry, was built around container images stored in Cloud Storage buckets. It worked well but was limited: it handled only container images, its permission model was tied to storage buckets, and it lacked features such as per-repository access, regional placement and support for other package types. Meanwhile, software teams used many package formats in the same project and wanted one consistent system rather than a different tool for each.
Artifact Registry was designed to fix this. It introduced repositories as first-class resources, each with a format, a location and its own permissions. It added more formats, regional and multi-regional storage, remote and virtual repositories, cleanup policies, and tighter links to security scanning and deployment tools. Over time, Container Registry was phased out in favor of it.
Images in Buckets
Early container image storage relied on Cloud Storage buckets with project-wide permissions and a single format.
Many Package Tools
Teams ran separate systems for Java, JavaScript, Python and operating system packages, each with its own rules.
A Unified Registry
Artifact Registry brings multiple formats under one service with repository-level control.
Supply Chain Focus
Scanning, metadata, provenance and policy checks tie the registry into broader software supply chain security.
Retirement of the Old Service
Container Registry is replaced, with Artifact Registry taking over the role, including support for legacy gcr.io addresses.
3Core Concepts and Vocabulary
A handful of terms appear in every conversation about Artifact Registry. Learn them once and everything else becomes easier.
Repository
A named storage space for artifacts of one format in one location. Repositories are the main unit of organization and access control.
Package or Image
A named software item inside a repository, such as a container image called “web-app” or a library called “payments-client”.
Version
One specific release of a package, identified by a version number or, for container images, by a unique digest.
Tag
A human-friendly label on a container image, such as “latest” or “v1.4.2”. Tags can move; digests cannot.
Digest
A unique fingerprint of a container image’s exact contents. If the content changes, the digest changes.
Format
The kind of artifact a repository holds, such as Docker, Maven, npm or Python.
Location
The region or multi-region where a repository’s data is stored.
Repository Mode
Standard, remote or virtual. The mode decides where artifacts come from and how they are served.
Upstream Source
An outside registry, such as a public package index, from which a remote repository fetches and caches items.
Artifact Analysis
The companion service that scans artifacts for known vulnerabilities and stores related metadata.
Imagine a music streaming app. A repository is a playlist folder for one type of media, a package is a song, a version is a specific recording of that song, a tag is the friendly name like “live version”, and a digest is the unique file fingerprint that proves it is exactly the recording you expect.
flowchart TD
P[Google Cloud Project] --> R1[Repository: Docker, us-central1]
P --> R2[Repository: Maven, europe-west1]
P --> R3[Repository: Python, us-central1]
R1 --> I1[Image: web-app]
I1 --> V1[Version by Digest]
V1 --> T1[Tags: v1.4.2, latest]
R2 --> PK[Package: payments-client]
PK --> V2[Versions 1.0, 1.1, 1.2]
4Supported Formats
One of Artifact Registry’s biggest strengths is that it speaks the languages of many tools.
| Format | What It Holds | Typical Tools |
|---|---|---|
| Docker and OCI images | Container images for applications | Docker, Podman, Kubernetes, Cloud Run, Cloud Build |
| Helm charts | Packaged Kubernetes application definitions stored in OCI form | Helm, GKE, deployment tools |
| Maven | Java libraries and plugins | Maven, Gradle |
| npm | JavaScript and TypeScript packages | npm, yarn, pnpm |
| Python | Python packages | pip, twine, poetry |
| Go modules | Go libraries | Go toolchain |
| Apt and Yum | Operating system packages for Debian and Red Hat style systems | apt, yum, dnf |
| Kubeflow pipelines | Machine learning pipeline templates | Vertex AI and Kubeflow tools |
| Generic | Arbitrary files such as binaries and archives | Command line tools and custom scripts |
Support for formats can grow over time, and some formats have their own limits and rules. Check the current list in the official documentation before you plan around a specific format.
Why one registry for many formats helps
One Permission Model
The same IAM approach controls access, no matter which format you store.
One Place to Audit
Logs and policies live together, which makes compliance reviews easier.
One Network Path
Private networking and perimeter controls apply to all artifacts consistently.
One Bill
Storage and transfer costs are in a single, understandable service.
Assuming one repository can hold several formats. Each repository has exactly one format. Create separate repositories for Docker images, Maven libraries, Python packages and so on.
5Repository Modes: Standard, Remote and Virtual
Not all repositories work the same way. The mode you choose shapes how artifacts get in and how they are served.
Standard Repository
The normal kind. You upload your own artifacts, such as images built by your pipeline, and the repository stores and serves them.
Remote Repository
A caching proxy for an outside source. The first request fetches the item from the upstream source and stores a copy, and later requests are served from the cache.
Virtual Repository
A single address that combines several repositories behind it, checking them in a priority order you define.
Standard repositories
This is where you publish what you build. A build pipeline creates a container image or library, pushes it to a standard repository, and downstream systems pull it from there. You control who can write to it and who can read from it.
Remote repositories
A remote repository acts as a smart middleman between your builds and a public registry. Instead of every build reaching out to the internet, builds ask your remote repository, which fetches the item once and keeps a copy. This speeds up builds, reduces dependence on outside availability, can help avoid rate limits imposed by public registries and lets you apply your own scanning and access controls to third-party packages. Upstream sources can include well-known public registries and package indexes, and in some cases custom upstream addresses with credentials stored securely.
Virtual repositories
Developers do not want to configure ten different addresses. A virtual repository gives them one address. Behind it, you list the underlying repositories, for instance your own internal packages and a remote repository for the public index, and give each a priority. When someone asks for a package, the virtual repository checks them in order. This also helps defend against dependency confusion attacks, where an attacker publishes a public package with the same name as one of your private packages, because you can set your private repository to a higher priority.
flowchart TD
D[Developer or Build Tool] --> V[Virtual Repository: One Address]
V -->|Priority 1| S[Standard Repository: Internal Packages]
V -->|Priority 2| R[Remote Repository: Cache of Public Index]
R --> U[Upstream Public Registry]
A standard repository is your own pantry. A remote repository is a local store that buys from a big wholesaler once and keeps stock on its shelves for you. A virtual repository is a single shopping list that first checks your pantry, then the local store, so you never have to know where each item actually came from.
Problem
Letting build tools fetch packages directly from public sources and your private repository with no defined order of priority.
Why It’s Harmful
A malicious public package with the same name as an internal one can be pulled in by mistake, and builds may break whenever the public source is slow or unavailable.
Correct Approach
Use a virtual repository that places internal repositories ahead of remote ones, and route public dependencies through a remote repository cache.
6Locations, Addresses and Naming
Where a repository lives, and how you address it, affects speed, cost, compliance and day-to-day usage.
Regional and multi-regional repositories
When you create a repository, you choose a location. A regional repository stores data in one region, such as one near your servers. A multi-regional repository stores data across a larger area, such as the United States, Europe or Asia, which can improve availability and serve widely distributed users. For most workloads, a regional repository in the same region as your build and deployment systems gives the best speed and the lowest transfer cost.
The shape of an address
Each format has a host name based on the format and location, followed by the project, the repository and the package. For container images, the address looks like a location-based host name, then the project identifier, then the repository name, then the image name with a tag or digest. Knowing this pattern makes it easy to read configuration files and logs.
| Part of the Address | Meaning | Example in Words |
|---|---|---|
| Host | Location plus format service | The docker service in the us-central1 region |
| Project | The Google Cloud project that owns the repository | Your project’s identifier |
| Repository | The named repository | “prod-images” |
| Image or package | The item inside the repository | “web-app” |
| Tag or digest | The version label or fingerprint | “v1.4.2” or the unique digest |
Choosing locations wisely
Stay Close to Consumers
Place repositories in the same region as the clusters and services that pull from them to cut delay and avoid network charges.
Respect Data Residency
Choose locations that meet legal requirements for where software and its data may be stored.
Use Multi-Region for Wide Reach
If systems in several continents pull the same images, consider a multi-regional repository or copies in several regions.
Name Consistently
Adopt naming such as team, environment and purpose, so repositories are easy to find and secure.
A repository’s location cannot be changed after creation. If you need to move, you create a new repository in the new location and copy artifacts over. Choose carefully at the start.
7Internal Working: What Happens When You Push and Pull
A look at the journey of an artifact makes the rest of the service easier to understand.
Pushing a container image
A container image is made of layers, which are stacked chunks of files, plus a manifest that lists the layers and a small configuration. When you push an image, your tool checks which layers the registry already has, uploads only the missing ones, and then uploads the manifest. Because layers are shared, many images that share a common base only store that base once, saving space and time.
Authenticate
Your tool proves who it is, typically with a Google Cloud identity or a service account token.
Authorize
The service checks that the identity has permission to write to that specific repository.
Upload Missing Layers
Only layers not already stored are sent, which makes repeat pushes fast.
Store the Manifest and Tag
The manifest is saved, the digest is computed and tags are attached.
Trigger Scanning and Events
If scanning is enabled, analysis begins, and notifications can be published for automation.
Pulling an artifact
When a cluster or service pulls an image, it authenticates, requests the manifest by tag or digest, then downloads the needed layers. For remote repositories, if the item is not yet cached, the service first fetches it from the upstream source, stores it and then serves it. For virtual repositories, the service checks the underlying repositories in priority order.
sequenceDiagram
participant B as Build Pipeline
participant AR as Artifact Registry
participant AA as Artifact Analysis
participant K as GKE or Cloud Run
B->>AR: Push image layers and manifest
AR->>AA: Request vulnerability scan
AA-->>AR: Store findings and metadata
K->>AR: Pull image by tag or digest
AR-->>K: Return manifest and layers
Shipping a sandwich shop’s meal kits: you pack ingredients in standard boxes (layers). If the warehouse already holds the boxes of lettuce and bread from last week, you only send the new filling. The packing list (the manifest) tells the receiver which boxes to open.
Smaller images push and pull faster. Using lean base images, combining steps to reduce layers and ordering instructions so rarely changing layers come first lets the registry reuse more and saves both time and storage.
8Access Control and Authentication
Because artifacts become running software, controlling who can read and write them is a core security task.
IAM at the repository level
Access is managed through Identity and Access Management. You can grant roles at the project level, which affects every repository in the project, or at the repository level, which affects only that repository. Repository-level permissions are the preferred approach, because they follow the principle of least privilege.
Reader
Can download and view artifacts. Suitable for clusters, services and developers who only consume.
Writer
Can read and upload artifacts. Suitable for build pipelines that publish.
Repository Administrator
Can manage a repository’s settings, permissions and contents, including deletion.
Administrator
Can create and manage repositories across a project.
How tools authenticate
| Method | How It Works | Best For |
|---|---|---|
| Credential helper | The Google Cloud command line configures your container tool to use your current identity | Developers working from their own machines |
| Service account on the platform | GKE nodes, Cloud Run and Cloud Build use their attached service accounts automatically | Deployed workloads and managed build services |
| Short-lived access tokens | A temporary token is used as the password | Scripts and external CI systems needing quick access |
| Workload identity federation | Outside systems exchange their own identity for Google Cloud access without long-lived keys | CI systems outside Google Cloud, such as hosted pipelines |
| Service account keys | A downloadable key file | Last resort; avoid when better methods exist |
Downloading long-lived service account key files and storing them in build systems or code. Keys leak easily and are hard to rotate. Prefer attached service accounts, short-lived tokens or workload identity federation.
Public access
Repositories can be made readable by anyone, for example to share an open-source package. This is powerful but risky. Be deliberate: review exactly what a repository contains, and never make a repository public if it might hold private code, configuration or secrets baked into images.
Problem
Granting broad project-level writer or administrator roles to many people and pipelines for convenience.
Why It’s Harmful
Anyone with write access can replace an image that production trusts, and a single compromised account can poison every repository in the project.
Correct Approach
Grant repository-level roles, give only build pipelines write access to release repositories, and give runtime systems read-only access.
9Vulnerability Scanning and Artifact Analysis
Storing artifacts is only half the job. Knowing whether they are safe is the other half.
What scanning does
Artifact Analysis examines the contents of your artifacts, such as the operating system packages and language libraries inside a container image, and compares them to databases of publicly known security weaknesses. It then records the findings, with severity levels, against the specific image version. Scanning can run automatically when an image is pushed and can continue as new weaknesses are discovered, because an image that was clean yesterday may be flagged tomorrow.
Think of a food warehouse inspector who checks every delivery against a list of recalled products. The list keeps growing. A product that passed inspection last month might be recalled this week, so the inspector re-checks stock regularly and flags affected items.
Automatic Scanning
Scans images pushed to supported repositories and keeps findings up to date as new weaknesses become known.
On-Demand Scanning
Scan an image on request, including images on your own machine before pushing it, useful in pipelines as a gate.
Language Package Scanning
Looks inside supported language packages bundled in images, not only operating system packages.
Software Bill of Materials
A list of every component inside an artifact, useful for audits and for finding where a newly discovered weakness exists.
Metadata and Provenance
Records of how and where an artifact was built, which builder produced it and which source it came from.
Using findings well
Scan Early in the Pipeline
Catch problems before images reach shared repositories, using on-demand scanning during builds.
Set a Policy
Decide what is unacceptable, for example any critical weakness with an available fix.
Fix at the Source
Update base images and libraries, rebuild and redeploy rather than patching running containers by hand.
Monitor Continuously
Watch for new findings on images already in production and track time to fix.
Treating scan results as a one-time checkbox. New weaknesses are discovered constantly, so an image that was clean at release can become risky. Rebuild and redeploy regularly, and review findings for long-lived images.
10Software Supply Chain Security: Provenance and Enforcement
A secure registry is one link in a chain. The goal is to know that what runs in production is exactly what you built and approved.
Why supply chain security matters
Attackers increasingly target the steps between writing code and running it: compromised build systems, poisoned dependencies and swapped images. A secure software supply chain aims to make each step verifiable, so that you can prove where an artifact came from and that nobody changed it along the way.
The building blocks
Build Provenance
A signed record created by your build system describing what was built, from which source and by which process.
Attestations
Signed statements about an artifact, such as “this image passed vulnerability checks” or “this image passed integration tests”.
Digest Pinning
Referencing images by their unique digest rather than a movable tag, so what is deployed is exactly what was approved.
Admission Policy
A gatekeeper, such as Binary Authorization on supported platforms, that refuses to deploy images lacking the required attestations.
flowchart LR
A[Source Code] --> B[Trusted Build with Provenance]
B --> C[Push Image to Artifact Registry]
C --> D[Scan and Test]
D --> E[Create Attestation]
E --> F{Deployment Policy Check}
F -->|Required proof present| G[Deploy to GKE or Cloud Run]
F -->|Missing proof| H[Deployment Blocked]
Think of a passport check at an airport. The traveler (the image) needs a passport (attestation) stamped by trusted offices (the build and scan steps). Without the right stamps, the gate does not open, no matter how confident the traveler looks.
Begin in audit mode. Many policy tools can first log what they would have blocked, so you can fix gaps without breaking deployments, and then move to enforcement once the pipeline reliably produces the right proof.
11Tagging, Versioning and Immutability
How you label artifacts decides how safely and predictably you can deploy and roll back.
Tags can move, digests cannot
A tag such as “latest” is just a label that can be reassigned to a different image at any time. If a deployment refers to “latest”, two servers started a day apart might run different code without anyone noticing. A digest is a fingerprint of exact content and never changes. For anything important, deploy by digest, or by a version tag that your process never reuses.
Immutable tags
Docker repositories can be configured so that a tag, once assigned, cannot be moved to a different image. This prevents accidental or malicious overwriting and gives each release label a permanent meaning.
| Strategy | Example | Strength | Weakness |
|---|---|---|---|
| Digest | Reference by the exact content fingerprint | Perfectly reproducible | Hard for humans to read |
| Semantic version tag | v1.4.2 | Readable and meaningful | Needs discipline not to reuse |
| Commit-based tag | Short source commit identifier | Traceable to the exact code | Not obviously ordered |
| Environment tag | staging, production | Shows promotion state | Moves, so avoid for deployment references |
| Latest | latest | Convenient for experiments | Unpredictable; avoid in production |
Promotion across environments
A common pattern keeps separate repositories for different stages, such as development, staging and production. An image is built once, tested, and then promoted by copying the same image, with the same digest, into the next repository, rather than rebuilding it. This ensures the thing you tested is the thing you ship, and lets you restrict who can write to the production repository to your trusted pipeline only.
Build Once
The pipeline builds an image and pushes it to a development repository.
Test and Scan
Automated tests and scans run against that exact image.
Promote by Copying
If checks pass, the same image is copied into the staging, then the production repository.
Deploy by Digest
Deployment references the image by its digest or by an immutable version tag.
Problem
Deploying production workloads using the “latest” tag, or rebuilding the image separately for each environment.
Why It’s Harmful
Different servers may run different code, rollbacks become guesses, and the image that was tested may not be the image that ships.
Correct Approach
Build once, tag with immutable versions, promote the same image between environments and deploy by digest.
12Cleanup Policies and Storage Hygiene
Left alone, registries grow forever. Every build adds new versions, and storage is billed.
The problem of endless growth
A busy team may push hundreds of images a day. Most are old test builds that nobody will ever use again. Without cleanup, storage costs climb, searching becomes noisy and scanning covers many stale items.
Cleanup policies
Cleanup policies let you define rules that automatically delete or keep versions in a repository. Rules can be based on tag status, tag prefixes, version age or the number of recent versions to keep. You can combine “delete” rules with “keep” rules, where keep rules take priority so you never lose the artifacts you need. A dry run mode shows what would be deleted before you turn the policy on.
Delete Untagged Versions
Remove images that no longer have any tag, which are often leftovers from earlier builds.
Delete Old Test Builds
Remove versions with a development-style tag after a set number of days.
Keep Recent Releases
Always keep the latest several versions of each package, for rollback.
Keep Release-Tagged Versions
Protect versions carrying release tags from automatic deletion.
Decide What Must Be Kept
List the releases, rollback targets and compliance items that must never be deleted.
Define Cleanup Rules
Write delete rules for the clutter, and keep rules for the protected items.
Run in Dry-Run Mode
Review the report of what would be deleted, and adjust.
Enable and Monitor
Turn the policy on and watch storage and any complaints from teams.
Turning on aggressive deletion without a dry run, then discovering that a rollback image or a rarely deployed service’s image was deleted. Always preview, and add keep rules for important versions.
13Integrations: Cloud Build, GKE, Cloud Run and CI/CD
Artifact Registry sits in the middle of the delivery pipeline. Here is how it connects to its neighbors.
Cloud Build
Builds images and packages and publishes them to the registry. Build provenance records can be attached automatically.
Google Kubernetes Engine
Clusters pull images from repositories using node or workload identities, ideally with read-only access.
Cloud Run
Deploys container images from the registry as serverless services and jobs.
Cloud Deploy
Delivery pipelines promote a release through environments using images stored in the registry.
Compute Engine and Other Runtimes
Virtual machines and other platforms can pull images or packages with proper credentials.
External CI Systems
Hosted pipelines can push and pull using workload identity federation or short-lived tokens.
Pub/Sub Notifications
Repository events can be published so other systems react to new pushes automatically.
Binary Authorization and Security Tools
Policies and scanners use registry metadata to decide what may deploy.
flowchart LR
DEV[Developer Commits Code] --> CB[Cloud Build]
CB --> AR[Artifact Registry]
AR --> SCAN[Artifact Analysis Scan]
AR --> CD[Cloud Deploy]
CD --> GKE[GKE Cluster]
CD --> CR[Cloud Run]
AR --> PS[Pub/Sub Notification]
PS --> AUTO[Automation and Alerts]
When a cluster fails to pull an image, the cause is almost always one of three things: the wrong address, missing read permission for the cluster’s identity, or a network path that cannot reach the registry. Check them in that order.
14Networking, Encryption and Compliance
Artifacts often contain valuable code, so the network and encryption layers matter.
Private Access
Machines without external addresses can reach the registry using Private Google Access, keeping traffic off the public internet.
VPC Service Controls
A perimeter around the service reduces the risk of artifacts being copied outside approved boundaries.
Encryption at Rest and in Transit
Data is encrypted by default. Customer-managed encryption keys are available if your policies require control over keys.
Audit Logs
Admin and data access logs record who changed or retrieved artifacts, supporting investigations.
Location and Residency
Choose repository locations that meet legal requirements for where software is stored.
Secret Handling
Store upstream credentials for remote repositories in a secure secrets service, never in configuration files.
Baking passwords, keys or tokens into container images or packages. Anyone who can read the artifact can extract them, and scans may not catch them. Keep secrets out of artifacts and inject them at runtime from a secrets service.
15Migrating from Container Registry
Many organizations started with Container Registry. Moving to Artifact Registry is a common, well-trodden task.
What changes
Container Registry stored images in buckets with bucket-level permissions and project-wide addressing. Artifact Registry uses repositories with their own permissions and different host names. Google provides ways to keep older gcr.io style addresses working by hosting them in Artifact Registry, and tools to copy existing images, so most migrations are gradual rather than abrupt.
Inventory What You Have
List the images, projects and systems that use the old addresses, including builds, clusters and scripts.
Create Repositories
Create repositories in suitable locations, with the repository-level permissions you actually want.
Copy or Redirect
Copy images over, or enable the support for legacy domain names so existing references continue to work.
Update Consumers
Change build configurations, deployment files and clusters to the new addresses over time.
Verify and Retire
Confirm that nothing still depends on the old paths and remove obsolete resources.
Use the move as a chance to improve security: switch from broad project-wide access to repository-level roles, introduce cleanup policies and enable scanning, instead of copying the old setup exactly.
16Monitoring, Logging and Troubleshooting
When a deployment fails to fetch an image at midnight, you want answers quickly.
| Symptom | Likely Cause | What To Check |
|---|---|---|
| Permission denied on pull | Runtime identity lacks reader access | Repository-level IAM for the cluster or service identity |
| Permission denied on push | Pipeline identity lacks writer access | Roles on the target repository and correct authentication |
| Image not found | Wrong location, repository, name or tag | Full address, region and whether the version was cleaned up |
| Pull is very slow | Cross-region pulls or huge images | Repository location versus cluster region, image size and layer reuse |
| Builds fail to fetch dependencies | Upstream unavailable or wrong virtual repository priority | Remote repository status, priorities and credentials |
| Unexpected package version used | Dependency confusion or wrong priority order | Virtual repository ordering and version rules |
| Unexpected storage growth | No cleanup policy or many large images | Cleanup rules and image sizes |
| Scan results missing | Scanning not enabled or unsupported content | Scanning settings and supported formats |
What to monitor
Audit Logs
Who pushed, deleted or changed permissions, especially on production repositories.
Storage Growth
Track repository sizes so unexpected jumps are noticed early.
Vulnerability Findings
Count and age of critical findings in images currently deployed.
Quota and Request Metrics
Watch request rates and quotas so bursts of pulls do not hit limits.
Large clusters that start many pods at once can generate a burst of pulls. Keep images small, spread rollouts out, and make sure quotas leave headroom for such bursts.
17Cost and Pricing
Artifact Registry costs are modest compared with compute, but they can still surprise you.
Storage
Billed per gigabyte per month for stored artifacts, often with a small free allowance. This usually grows steadily without cleanup.
Network Egress
Pulling artifacts within the same region is generally free of transfer charges, while moving data across regions or out of Google Cloud can incur costs.
Scanning
Vulnerability scanning has its own charges, which depend on the type and number of scans.
Remote Repository Caching
Cached upstream content counts as stored data, and fetching from upstream may involve outside transfer.
Build and Pipeline Time
Slow pulls and bloated images lengthen builds and deployments, which costs compute time.
Ways to keep costs down
Good Habits
- Use cleanup policies with keep rules and dry runs
- Keep repositories in the same region as consumers
- Build lean images with shared base layers
- Use remote repositories to cache heavily used public packages
- Promote one image across environments instead of rebuilding
- Review storage and scanning charges monthly
Cost Traps
- No cleanup, so storage grows without limit
- Cross-region pulls from large clusters
- Huge images with many unused tools and layers
- Duplicate copies of the same image in many repositories
- Pulling very large public images repeatedly with no cache
Prices and free allowances change over time and vary by region. Always confirm current rates on the official Artifact Registry pricing page before planning a budget.
18Artifact Registry Compared with Other Options
Several tools can store artifacts. Knowing the differences helps you choose.
| Option | What It Is | Best Fit |
|---|---|---|
| Artifact Registry | Managed multi-format registry on Google Cloud | Teams on Google Cloud wanting integrated, secure artifact storage |
| Container Registry | Earlier container-only service, now retired in favor of Artifact Registry | Not for new work; migrate existing use |
| Cloud Storage buckets | General object storage | Plain files and archives without registry features |
| Public registries such as Docker Hub | Hosted public image and package sources | Open-source sharing, used through a remote repository cache for safety and reliability |
| Self-hosted artifact managers | Software you run yourself for storing artifacts | Organizations with special needs or multicloud setups who accept the operations work |
| Other cloud providers’ registries | Equivalent services in other clouds | Workloads primarily running in those clouds |
A Cloud Storage bucket is a big empty garage where you can put anything. Artifact Registry is a purpose-built warehouse with labeled aisles, a security desk, an inspection counter and an inventory system. You can store boxes in a garage, but you will miss the inventory and the inspector.
flowchart TD
Q1{Are you running software on Google Cloud?} -->|Yes| Q2{Need containers or language packages?}
Q1 -->|No| A1[Consider the registry of your main cloud]
Q2 -->|Yes| A2[Artifact Registry]
Q2 -->|No| Q3{Only plain files?}
Q3 -->|Yes| A3[Cloud Storage or Generic format repository]
Q3 -->|No| A2
19Design Patterns and Anti-patterns
Patterns capture what experienced teams repeatedly find works; anti-patterns capture what goes wrong.
Helpful patterns
Build Once, Promote Many
An image is built a single time, tested and scanned, then copied unchanged through development, staging and production repositories. The same digest runs everywhere.
Separate Repositories per Stage
Development repositories allow broad write access for developers, while production repositories allow writes only from the trusted release pipeline.
Remote Cache for Public Dependencies
Builds fetch public images and packages through a remote repository, speeding them up, avoiding rate limits and allowing scanning and control of third-party code.
Virtual Repository as the Single Address
Developers configure one address. Behind it, internal repositories take priority over cached public ones, protecting against dependency confusion.
Policy-Gated Deployment
Only images with required attestations, such as a passing scan and trusted build provenance, are allowed to run in production.
Regional Mirrors for Global Services
Images are copied to repositories in each region where clusters run, so pulls are fast and stay free of cross-region charges.
Anti-patterns to avoid
Problem
One giant repository for everything, with every team and environment sharing the same permissions.
Why It’s Harmful
Access cannot be limited sensibly, cleanup rules are blunt and a mistake by one team can affect all.
Correct Approach
Create repositories per team, format and stage, with tailored permissions and cleanup policies.
Problem
Using bloated, general-purpose base images with compilers, shells and tools that the application never needs at runtime.
Why It’s Harmful
Images are larger, slower to move and carry many more components that can contain vulnerabilities.
Correct Approach
Use minimal runtime images and multi-stage builds, so the final image contains only what is needed to run.
Problem
Allowing developers to push directly from laptops to production repositories.
Why It’s Harmful
Untested, unscanned and untraceable artifacts can reach production, and there is no reliable record of how they were built.
Correct Approach
Restrict production writes to the automated pipeline and require provenance and checks for every release.
20Advantages, Disadvantages and Real-World Uses
An honest view of strengths, limits and where teams actually use the service.
Advantages
- Fully managed with no servers or storage to operate
- One service for many artifact formats
- Repository-level IAM for fine-grained access control
- Remote and virtual repositories for caching and safe dependency management
- Integrated vulnerability scanning, metadata and provenance
- Cleanup policies to control growth and cost
- Tight integration with Cloud Build, GKE, Cloud Run and Cloud Deploy
Disadvantages / Trade-offs
- Repository location cannot be changed after creation
- One format per repository means more repositories to manage
- Costs for storage, scanning and cross-region transfer need attention
- Best experience is within Google Cloud; multicloud setups need extra identity work
- Some formats have specific rules and limits to learn
- Migration from older registries takes planning
Real-world examples
Microservices Platform
A company with dozens of services builds each one in Cloud Build, pushes images to team repositories, scans them and promotes tested images to a production repository. GKE clusters pull by digest with read-only access.
Java Enterprise Libraries
A large organization hosts shared internal Java libraries in a Maven repository, with a virtual repository combining them and a cache of the public library index, so builds are fast and private libraries always take priority.
Regulated Financial Firm
A bank enforces that only images built by its trusted pipeline, scanned and attested, can run in production. Repositories sit inside a service perimeter with customer-managed keys and full audit logging.
Data Science Teams
Teams publish internal Python packages and machine learning pipeline templates to repositories, so models and notebooks use consistent, versioned code across projects.
Open-Source Project
A project publishes release images and packages from a public repository with a clear versioning scheme and immutable tags, while keeping its internal build repositories private.
21Best Practices and Frequently Asked Questions
A checklist to carry into every project, followed by answers to common beginner questions.
Best Practices
- Create separate repositories per format, team and environment
- Choose locations near consumers and meeting residency rules
- Grant repository-level roles with least privilege; runtime systems read-only
- Avoid long-lived keys; use attached identities, short-lived tokens or federation
- Deploy by digest or immutable version tags, never by “latest”
- Build once and promote the same image between environments
- Enable scanning and act on findings; rebuild regularly
- Use remote and virtual repositories to cache and control dependencies
- Apply cleanup policies with keep rules and dry runs
- Keep secrets out of artifacts and enable audit logging
Common Mistakes
- Broad project-level write access
- Deploying with movable tags
- No cleanup, leading to endless storage growth
- Cross-region pulls and oversized images
- Treating a single scan as permanent safety
- Mixing private and public package sources without priorities
- Baking secrets into images
- Pushing to production from laptops
No. Artifact Registry is the newer, broader service that replaces Container Registry. It supports many formats, repository-level permissions and more features, and it can serve older gcr.io style addresses to ease migration.
Container and OCI images, Helm charts, and packages for Maven, npm, Python, Go, Apt and Yum, plus Kubeflow pipeline templates and generic files. Check current documentation for the full and latest list.
A standard repository stores artifacts you publish. A remote repository caches items from an outside source. A virtual repository gives one address that checks several repositories in priority order.
Because it can point to different images over time, so deployments are unpredictable and rollbacks are unclear. Use digests or immutable version tags.
Grant the cluster’s workload or node identity read access on the specific repository, and make sure it has a network path to the service, such as Private Google Access. Avoid embedding long-lived keys.
Yes, through Artifact Analysis, which can scan supported artifacts automatically or on demand and record findings. Scanning has its own settings and cost, so review them for your setup.
No. You create a new repository in the desired location and copy the artifacts, then update the consumers.
Use cleanup policies with rules to delete old or untagged versions and keep rules for releases and recent versions. Test with a dry run first.
Use a virtual repository that ranks internal repositories above remote ones, so internal packages are always chosen when names match, and control which public packages are allowed.
Yes. Use workload identity federation or short-lived tokens so the external system gets temporary Google Cloud access without storing long-lived keys.
Build in a trusted pipeline that records provenance, scan and attest the image, deploy by digest, and use a deployment policy such as Binary Authorization to block images that lack required proof.
Storage, network transfer especially across regions or out of Google Cloud, scanning, and the compute time affected by slow pulls. Cleanup policies and regional placement help control them.
22Summary and Key Takeaways
Artifact Registry is Google Cloud’s managed home for the building blocks of software: container images, Helm charts and language and operating system packages. Repositories organize artifacts by format and location, while standard, remote and virtual modes cover everything from your own releases to cached public dependencies behind one safe address. Repository-level IAM, private networking, encryption and audit logs control access; Artifact Analysis, provenance and attestations add visibility and proof; tagging discipline, immutable versions and promotion keep deployments predictable; and cleanup policies and regional placement keep costs in check. Connected to Cloud Build, GKE, Cloud Run and Cloud Deploy, it becomes the trusted middle of a delivery pipeline. Treat it as a supply chain control point, not just storage, and review current documentation for formats, limits and pricing.
Key Takeaways
- One registry, many formats — store container images, Helm charts and Maven, npm, Python, Go and OS packages, each in its own repository, replacing the retired Container Registry.
- Pick the right mode — standard for your own artifacts, remote to cache public sources, virtual to combine repositories with priorities that guard against dependency confusion.
- Least privilege at the repository level — readers for runtimes, writers only for trusted pipelines, and no long-lived keys where better identities exist.
- Deploy by digest, build once — avoid “latest”, use immutable tags, and promote the same tested image through environments.
- Scan and prove — enable vulnerability scanning, rebuild regularly, and use provenance and attestations with deployment policies to block unproven images.
- Control growth and cost — use cleanup policies with keep rules and dry runs, keep repositories near consumers and build lean images.
- Secure the surroundings — private access, service perimeters, encryption, audit logs and no secrets baked into artifacts.
