Google Cloud Artifact Registry: One Safe Home for Every Image and Package You Build

Google Cloud Artifact Registry: One Safe Home for Every Image and Package You Build

A beginner-friendly, book-style guide to Artifact Registry, the fully managed Google Cloud service that stores, protects and delivers container images and software packages to your build pipelines and running applications.

Imagine a large bakery chain. Every morning the central kitchen bakes thousands of loaves and ships them to hundreds of shops. If the loaves were left on a loading dock with no labels, no locks and no list of what is inside, shops would receive the wrong bread, old bread, or bread that someone had tampered with. A good bakery keeps a clean, labeled, locked warehouse where every batch is recorded, checked and handed out only to authorized delivery drivers. Artifact Registry is that warehouse for software.

This guide assumes you know nothing about software delivery. Every new word is explained the first time it appears, with a simple comparison from daily life. By the end you will understand what Artifact Registry is, what it stores, how repositories are organized, how to control access, how to keep your supply chain safe, how to control cost, and how it fits with the rest of Google Cloud.

1What Is Artifact Registry and Why Does It Exist?

Artifact Registry is a managed place to keep the files your software is built from and delivered in.

What is an artifact?

When developers write code, the code is not what actually runs in production. First it is compiled, packaged and bundled into files. These produced files are called artifacts. A container image, which is a sealed box holding an application and everything it needs to run, is an artifact. A Java library file, a Python package and a JavaScript module are also artifacts. Teams build many artifacts every day, and they must store them somewhere so that servers, test systems and other developers can fetch them.

The problem of scattered artifacts

Without a central, managed store, artifacts end up on personal laptops, shared folders or public websites. Nobody knows which version is the latest, who can download it, whether it contains a known security flaw, or whether it came from a trustworthy source. If a public website that hosts a library goes down, every build that depends on it fails. If someone uploads a malicious package with a familiar name, it can slip into your product unnoticed.

What the service does

Artifact Registry is a fully managed service that stores container images and language packages in private repositories inside your Google Cloud project. It controls who can read and write them using Google Cloud identity, scans images for known weaknesses, can cache packages from public sources, and works smoothly with Google Cloud build, deployment and runtime services. It also replaces the older Container Registry, which is being shut down.

Simple Analogy

A library does not just hold books. It catalogs them, lends them only to members, keeps old editions, removes damaged copies and records who borrowed what. Artifact Registry is a library for software parts.

Many
formats: container images, Maven, npm, Python, Go, apt, yum and more
3
repository modes: standard, remote and virtual
Private
repositories live inside your own project and are access controlled
i
Good to Know

Artifact Registry stores build outputs. It does not run your code. Think of it as the warehouse between your build system and the places where software is deployed.

2Core Concepts in Plain English

Twelve words you will meet in every Artifact Registry conversation.

Term 1

Artifact

Any file produced by a build that is stored and delivered, such as an image or a package.

Term 2

Repository

A named container inside Artifact Registry that holds artifacts of one format in one location.

Term 3

Container image

A packaged application with its dependencies, ready to be started as a container on a server or cluster.

Term 4

Package

A reusable library or program in a language ecosystem, such as a Java library, a Python package or a JavaScript module.

Term 5

Tag

A human friendly label on an image, such as a version name, that points to a specific build.

Term 6

Digest

A unique fingerprint of an image’s exact contents. Unlike a tag, it can never point to a different build.

Term 7

Upstream

An outside source of artifacts, such as a public package website, that a repository can fetch from.

Term 8

Cleanup policy

A rule that automatically deletes old or unused artifacts so storage does not grow forever.

Term 9

Vulnerability scan

An automatic check that compares the contents of an image with lists of known security flaws.

Term 10

Supply chain

Everything that touches your software before it runs: source code, build tools, libraries, images and the systems that move them.

Term 11

Pull and push

Pulling means downloading an artifact. Pushing means uploading one.

Term 12

Service account

A special identity for software, such as a build system, that is granted permission to push or pull.

These words will return with examples in later chapters. For now, hold the picture in mind: a build produces artifacts, repositories store them, and identities with the right permissions pull them to run.

3Where Artifact Registry Sits in the Software Journey

From a developer’s keyboard to a running application, Artifact Registry is the middle stop.

Software moves through a pipeline. A developer commits code. A build system compiles it, runs tests and produces an image or package. That artifact is pushed to Artifact Registry. A deployment system then pulls the artifact and starts it on a cluster, a serverless platform or virtual machines. Because every stage passes through the registry, it is the natural place to apply checks, record history and control access.

flowchart LR
DEV["Developer commits code"] --> BLD["Build system: compile and test"]
BLD -->|"Push"| AR["Artifact Registry"]
AR --> SCAN["Vulnerability scan"]
SCAN --> DEP["Deployment system"]
AR -->|"Pull"| RUN["GKE, Cloud Run, Compute Engine"]
DEP --> RUN
        
FIG 1 — Artifact Registry in a typical delivery pipeline
1

Build

A build system turns source code into an artifact, such as a container image.

2

Store

The artifact is pushed to a repository with a clear name and tag.

3

Check

Scans and policies inspect the artifact for known problems and rule violations.

4

Deploy

Approved artifacts are pulled by the platform that runs the application.

5

Retire

Old artifacts are cleaned up by policy, keeping what is still needed.

Simple Analogy

A factory’s finished goods warehouse sits between the production line and the delivery trucks. Everything passes through it, so it is the best place to count, inspect and label the goods.

4Supported Formats

One service, many kinds of artifacts, each in its own repository.

A repository holds one format. You create a separate repository for each format you use, and you set its location when you create it. The supported formats cover the most common ecosystems used to build software.

Containers

Docker and OCI images

Container images for Kubernetes, serverless platforms and virtual machines. Helm charts and other container-like artifacts can also be stored using the same standard.

Java

Maven and Gradle

Java libraries and applications, with optional rules about release or snapshot versions.

JavaScript

npm

Packages for JavaScript and TypeScript projects.

Python

Python packages

Libraries and tools for Python projects, installed with the usual package tools.

Go

Go modules

Modules for Go projects, including remote and virtual repositories.

Linux

Apt and Yum

Operating system packages for Debian and Red Hat style systems, useful for building consistent machine images.

Machine learning

Kubeflow pipeline packages

Packages used to define machine learning pipelines.

Other files

Generic artifacts

For files that do not fit a specific ecosystem, such as installers or archives. Availability and maturity of newer formats can change, so check the current documentation.

Simple Analogy

A warehouse has separate sections for frozen food, tools and clothing, because each needs its own shelving and rules. Each format gets its own repository for the same reason.

i
Tip

Name repositories by purpose and team, such as a payments team images repository, rather than a single giant repository for everything. Clear names make permissions and cleanup far easier.

5Repository Modes: Standard, Remote and Virtual

Three kinds of repository, for private storage, caching and combining.

Mode 1

Standard repository

Your private store. You upload your own artifacts and download them, with full control over contents and access.

Mode 2

Remote repository

A cache of an outside source, such as Docker Hub, Maven Central, npm, PyPI or Linux package sources. The first request fetches from the source, and later requests are served from your cache.

Mode 3

Virtual repository

One address that combines several repositories behind it, with priorities. Developers use one location, and the registry looks through the others in order.

flowchart TD
DEVS["Developers and Build Systems"] --> VR["Virtual Repository: one address"]
VR -->|"Priority 1"| SR["Standard Repository: private packages"]
VR -->|"Priority 2"| RR["Remote Repository: cache of public source"]
RR --> PUB["Public Package Source"]
        
FIG 2 — A virtual repository combining private and cached public packages

Why remote repositories matter

Pulling packages straight from the public internet on every build is slow and risky. The public site can be down, can change a package without warning, or can be blocked in a locked down network. A remote repository gives you a nearby copy, faster builds, a record of what was used, and a place to apply scanning and access rules. For container images, caching public images protects you from download rate limits on public registries.

Why virtual repositories matter

Developers should not need to know which of several repositories holds a package. A virtual repository gives them one address. Priorities decide which source wins when the same name appears in more than one place, and getting these priorities right is a security matter, as the next callout explains.

!
Dependency Confusion

If a public package has the same name as your private internal package, a badly ordered virtual repository could pick the public one, and an attacker could plant a malicious version. Put your private repository first, and keep internal package names distinctive.

Simple Analogy

A company kitchen keeps its own recipes in a private book, keeps a stock of common ingredients from the wholesaler so it never runs out, and gives cooks one pantry door that checks the private shelf first and the wholesale shelf second.

6Architecture, Locations and Naming

Where your artifacts live, and how their addresses are built.

Every repository is created in a location, which can be a single region or a multi-region such as a large geographic area. Choosing a location close to where artifacts are built and used makes pulls faster and keeps traffic inside Google’s network. A repository’s location cannot be changed after creation, so choose with care.

The address of an image

An image address has four parts: a host name that includes the location and the Artifact Registry domain, then the project, then the repository, then the image name with a tag or digest. Because the repository is part of the address, it also forms a natural boundary for permissions. Different repositories can have different access rules, even inside one project.

PartWhat it meansExample idea
Location hostRegion or multi-region plus the Artifact Registry domainA host for the us-central1 region
ProjectThe Google Cloud project that owns the repositoryYour project identifier
RepositoryThe named repository for this formatA repository named for the team
Image and tag or digestThe specific artifact and versionA service name with a version tag
flowchart TD
P["Google Cloud Project"] --> R1["Repository: Docker images, region A"]
P --> R2["Repository: Python packages, region A"]
P --> R3["Repository: Maven packages, multi-region"]
R1 --> I1["Image: web service"]
R1 --> I2["Image: worker service"]
I1 --> T1["Tag: version 1.4"]
I1 --> T2["Tag: version 1.5"]
        
FIG 3 — How a project, repositories, images and tags are organized
Simple Analogy

A postal address has a country, a city, a street and a house number. An artifact address narrows down in the same way, from location to project to repository to the exact item.

i
Tip

Keep repositories in the same region as the services that pull from them. Pulls within the same region are cheap and fast, and cross-region pulls add delay and network charges.

7Internal Working: Pushing and Pulling an Image

What happens behind the scenes when a build uploads an image and a cluster downloads it.

sequenceDiagram
participant B as Build System
participant R as Artifact Registry
participant I as IAM
participant K as Cluster or Runtime
B->>R: Push image layers
R->>I: Check writer permission
I-->>R: Allowed
R-->>B: Stored, digest returned
K->>R: Pull image by tag or digest
R->>I: Check reader permission
I-->>R: Allowed
R-->>K: Send image layers
        
FIG 4 — A push followed by a pull, with permission checks
1

Authenticate

The build system proves its identity, usually through a service account, using Google Cloud credentials.

2

Upload layers

Container images are made of layers. Only layers that the registry does not already have are uploaded, which saves time and space.

3

Record the digest and tag

The registry stores a manifest describing the image and returns its digest. A tag is attached as a friendly label.

4

Scan if enabled

If scanning is on, the image is analyzed for known vulnerabilities and the results are stored as metadata.

5

Pull on demand

A runtime requests the image by tag or digest, permissions are checked, and the layers are downloaded and cached on the machine.

Tag or digest?

A tag can be moved to point at a different image later, which is convenient but risky. A digest is a fingerprint of exact contents and never changes. For production deployments, pulling by digest guarantees you run exactly what was tested.

Simple Analogy

A tag is like the label on a shelf that a stock clerk can move to a different box. A digest is a serial number engraved on the box itself. When exactness matters, trust the serial number.

8Access Control and Identity

Decide exactly who can push, who can pull and who can manage.

Artifact Registry uses Google Cloud identity and access management. Roles can be granted on a whole project or, more precisely, on a single repository. The built-in roles separate duties clearly, so that people and systems get only what they need.

RoleWhat it allowsTypical holder
Artifact Registry ReaderDownload and view artifactsRuntime service accounts, such as clusters and serverless services
Artifact Registry WriterRead, and upload artifactsBuild and release pipelines
Artifact Registry Repository AdministratorManage a repository, including deleting artifactsTeam leads and platform owners
Artifact Registry AdministratorManage all repositories and settingsA small platform or security team

Principle of least privilege

Give each identity the lowest role that does the job. A runtime that only pulls images needs the reader role on the specific repository, not on the whole project. A build pipeline needs the writer role on its own repository, not on others. Avoid giving the administrator role to automation. Separate repositories for production and development let you give developers wide access to one and tight access to the other.

Rule 1

Grant on the repository

Use repository level roles instead of project wide ones where possible.

Rule 2

Use service accounts for machines

Builds and deployments use service accounts, not personal accounts.

Rule 3

Separate environments

Keep production artifacts in a repository that few identities can write to.

Rule 4

Review access regularly

Remove access that is no longer needed, and check audit logs.

Simple Analogy

Warehouse staff badges differ. Delivery drivers can collect goods, stock clerks can add goods, and the manager can discard goods and change shelving. Nobody gets the manager’s badge just because it is easier.

!
Common Mistake

Granting wide roles to the default compute service account to make something work. That account is often shared by many services, so one convenient permission becomes a very broad door.

9Securing the Software Supply Chain

An artifact store is the checkpoint where trust can be proven or lost.

Attacks on software increasingly target the supply chain, meaning the libraries, images and build tools that a product depends on. A single poisoned dependency can compromise thousands of systems. Artifact Registry gives several tools to reduce this risk, and works together with other Google Cloud services to form a chain of trust.

Tool 1

Vulnerability scanning

Artifact Analysis can scan images for known flaws and report severity. Scanning can be enabled or disabled per repository, which helps control noise and cost.

Tool 2

Immutable tags

For Docker repositories, you can prevent tags from being moved or deleted, so a tag always points to the same image.

Tool 3

Provenance and metadata

Records of how an artifact was built, such as which source and build system produced it, can be attached and checked.

Tool 4

Binary Authorization

A deployment control that allows only images that carry required approvals or signatures to run on supported platforms.

Tool 5

Remote repository control

Routing public packages through a repository you control gives one place to log, scan and restrict what enters.

Tool 6

Encryption keys

Repositories can use customer managed encryption keys when policy requires your own control of keys.

flowchart LR
SRC["Source code"] --> BLD["Trusted build"]
BLD --> IMG["Image pushed to repository"]
IMG --> SC["Vulnerability scan"]
SC --> AT["Attestation: approved"]
AT --> BA["Binary Authorization checks"]
BA -->|"Approved"| PROD["Production runs image"]
BA -->|"Rejected"| STOP["Deployment blocked"]
        
FIG 5 — A chain of trust from source to production
Simple Analogy

Food safety follows the same idea. Farms are inspected, trucks are sealed, warehouses record batches, and shops check the seals before selling. If any seal is missing, the product is not sold.

!
Common Mistake

Scanning images once and assuming they stay safe. New vulnerabilities are discovered daily, so an image that was clean last month can be risky today. Rescan, and rebuild images on a regular schedule.

“You cannot trust what you run unless you can prove where it came from.”

10Cleanup Policies and Storage Hygiene

Without cleaning, every build adds to your bill and your confusion.

Build systems can produce an image on every code change. In a busy team that is dozens a day, and old ones are almost never used again. Storage is billed by volume, and a cluttered repository makes it hard to find what is current. Cleanup policies automatically remove artifacts you no longer need, while keeping the ones you want.

Kinds of rules

Delete rules

Delete artifacts by age or by tag status, for example remove untagged images older than a number of days.

Conditional keep rules

Keep artifacts that match conditions, such as images with a release tag prefix, regardless of age.

Keep most recent versions

Keep a set number of the newest versions of each package, so there is always a few steps of history to roll back to.

Test before you delete

Deleting the wrong artifacts can break deployments. Cleanup policies offer a dry run mode, which only logs what would be deleted without removing anything. Always run a policy in dry run first, check the logs, and only then turn on real deletion. Keep rules in a clear order, since keep rules take priority over delete rules when they conflict.

1

Decide what must be kept

List release versions, current production images and rollback candidates.

2

Write keep rules first

Protect important artifacts with conditional keep and recent-version rules.

3

Add delete rules

Remove old untagged or temporary build artifacts after a sensible age.

4

Dry run and review

Check what the policy would delete, adjust, and then enable real deletion.

Simple Analogy

Cleaning a wardrobe has two lists: things you always keep, such as your best coat, and things to discard after a season. You check the discard pile before taking it to the bin.

11Integration with Other Google Cloud Services

Artifact Registry is most valuable as the shared hub of your delivery tools.

Build

Cloud Build

Builds images and packages and pushes them straight into repositories using its own service account.

Deploy

Cloud Deploy

Promotes the same image through test and production environments in a controlled delivery pipeline.

Kubernetes

Google Kubernetes Engine

Clusters pull images using the identity of their nodes or workloads, with reader access to repositories.

Serverless

Cloud Run and Cloud Run functions

Services deploy from container images stored in repositories, and cloud functions are built into images that are kept there.

Machines

Compute Engine

Virtual machines can pull images and install operating system packages from repositories.

Security

Artifact Analysis and Binary Authorization

Scan images and enforce deployment rules based on results and approvals.

Machine learning

Vertex AI

Training and serving containers, as well as pipeline packages, are stored and pulled from repositories.

Operations

Cloud Logging and Audit Logs

Record repository activity, such as pushes, pulls and deletes, for audits and investigations.

flowchart TD
GIT["Source repository"] --> CB["Cloud Build"]
CB --> AR["Artifact Registry"]
AR --> CD["Cloud Deploy"]
CD --> GKE["GKE cluster"]
CD --> CR["Cloud Run service"]
AR --> BA["Binary Authorization"]
BA --> GKE
        
FIG 6 — A delivery pipeline built around Artifact Registry
Simple Analogy

A railway hub connects lines from many towns. Artifact Registry is the hub station that connects builders, checkers and runners, so each only needs to know one meeting point.

12Moving from Container Registry

If you ever used the older service, here is the story and how to move.

Before Artifact Registry, Google offered Container Registry for images only. Container Registry has been deprecated and shut down, and Artifact Registry is the recommended replacement for storing container images. It adds support for non-container formats, finer access control and more location choices. Container Registry controlled access through Cloud Storage roles on hidden buckets, while Artifact Registry uses its own roles that separate reading, writing and administration more clearly.

Keeping old addresses working

Many systems have the old gcr.io addresses written into deployment files. Artifact Registry can host repositories that answer requests for the gcr.io domain, in multi-region locations that match the old host names, so existing addresses keep working after migration. Google also provides a migration tool that creates matching repositories, copies images and helps map permissions. New projects without previous Container Registry usage already have images for the gcr.io domain hosted on Artifact Registry.

TopicContainer RegistryArtifact Registry
FormatsContainer images onlyImages and many package formats
Access controlCloud Storage rolesDedicated roles at repository or project level
LocationsFour multi-region hostsMany regions and multi-regions, with separate repositories
Remote and virtual repositoriesNoYes
Cleanup policiesManual or scriptedBuilt in
StatusDeprecated and shut downRecommended and actively developed
flowchart TD
A["Check Container Registry usage"] --> B["Create Artifact Registry repositories"]
B --> C["Map and grant IAM roles"]
C --> D["Copy images"]
D --> E["Update deployment files or use gcr.io hosting"]
E --> F["Test pulls and builds"]
F --> G["Retire old storage"]
        
FIG 7 — A typical migration path
!
Common Mistake

Migrating images but forgetting permissions. Pipelines and clusters that worked through Cloud Storage roles will fail to pull until the equivalent Artifact Registry roles are granted.

13Monitoring, Logging and Troubleshooting

When a deployment cannot pull an image, you need answers within minutes.

Artifact Registry records administrative actions and, if you enable them, data access events such as pulls and pushes, in audit logs. It can also produce platform logs for repository activity. Combined with Cloud Monitoring, this lets you see who accessed what, find failed requests and track usage and storage growth.

Problem 1

Permission denied on pull

The runtime identity lacks the reader role on the repository. Check the role and where it is granted.

Problem 2

Image not found

Wrong location, project, repository name or tag. Compare the address piece by piece.

Problem 3

Push rejected

Missing writer role, immutable tag rule, or a repository format mismatch.

Problem 4

Authentication failure

The tool is not configured to use Google Cloud credentials for the registry host.

Problem 5

Image vanished

A cleanup policy deleted it, or someone removed it. Check audit logs and policy history.

Problem 6

Slow pulls

The repository is in a distant region, or many large images are pulled at the same time without caching.

1

Read the exact error

It usually says whether the problem is permission, address or authentication.

2

Check the identity

Find out which service account made the request, and what roles it has on that repository.

3

Verify the address

Confirm location host, project, repository, image name and tag or digest.

4

Review audit logs

Look for recent deletions, permission changes or failed attempts around the time of failure.

i
Tip

Turn on data access audit logs for production repositories. They are the only way to answer who pulled a suspicious image, and they are far less useful if you enable them after an incident.

14Networking and Private Access

Make sure your private machines can reach the registry without touching the public internet.

Runtimes in private networks often have no internet access, yet they must still pull images. Google Cloud provides private routes for this. Private Google Access lets virtual machines without external addresses reach Google services, including Artifact Registry, through Google’s network. Private Service Connect and VPC Service Controls can add further isolation, so that artifacts and their metadata cannot be copied out of a defined perimeter.

Private clusters

A cluster with only private addresses pulls images through private access, and a firewall blocks other outbound traffic.

On-premises build servers

Builds in a company data center push and pull through a private connection such as a VPN or Interconnect, avoiding the public internet.

Locked down regulated environments

A service perimeter prevents data from leaving, while approved repositories inside the perimeter serve all artifacts needed.

Simple Analogy

A factory inside a secure compound gets deliveries through an internal tunnel from the warehouse next door, rather than sending trucks out onto public roads and back in through the main gate.

!
Common Mistake

Forgetting that the base images of your builds may come from public registries. If your network is locked down, make sure those images are cached through a remote repository, or the builds will fail in the secure zone.

15Understanding Cost and Pricing

Storage and network traffic drive most of the bill, and both are controllable.

Artifact Registry is billed mainly on the amount of data stored and on network traffic that leaves a location, with a small free storage allowance. Pulls inside the same region are generally free of network charges, while pulls across regions or out to the internet follow standard network rates. Vulnerability scanning has its own charges, and billing begins once the scanning service is enabled for a project. Exact rates vary and change, so use the official pricing page and calculator.

Storage
billed by the volume of artifacts you keep
Network
same-region pulls are cheap, cross-region and internet cost more
Scanning
a separate charge once the scanning service is enabled
Cost driverWhy it growsHow to control it
Stored images and packagesEvery build adds moreUse cleanup policies with dry runs
Large imagesBig base images and unneeded filesUse slim base images and multi-stage builds
Cross-region pullsRepository far from the runtimePlace repositories near runtimes, or replicate where needed
Internet egressPulls from outside Google CloudUse private paths and caches
Vulnerability scanningScans of every new image and updatesEnable scanning on repositories that need it
Duplicate repositoriesSame images stored many timesShare a repository across projects with proper access
!
Cost Reminder

Registries grow quietly. A repository without cleanup rules can grow for years, and nobody notices until the bill reveals thousands of images from long-dead builds. Add cleanup rules on day one.

i
Tip

Smaller images save money three times: less storage, less network traffic and faster startup. Trim base images and remove build tools from final images.

16Real-World and Industry Examples

Where a trusted artifact store keeps delivery smooth.

These are common patterns rather than named customer stories, because specific designs change over time.

Microservices platforms

Dozens of teams build and release their own services, each with images in its own repository, and a central platform team controls the rules and cleanup.

Financial services and regulated industries

Strict controls require scanned, signed images, audit logs of every pull, customer managed keys and private networking.

Software vendors

Companies that build libraries and products store internal packages, publish releases and keep a clean history of versions.

Machine learning teams

Training and serving containers, and pipeline packages, are versioned so experiments and models can be reproduced exactly.

Retail and e-commerce

Release pipelines push many small updates during campaigns, with quick, controlled rollbacks by pulling an earlier image.

Gaming and media

Game server images are built often and pulled quickly to many regions when launches or events create sudden demand.

Enterprises with restricted networks

Teams cache public packages in remote repositories so that builds work in networks with no direct internet access.

17Advantages, Disadvantages and Trade-offs

A managed store gives control and convenience, and asks for care with permissions and cost.

Advantages

  • Fully managed storage with no servers to run
  • One service for images and many package formats
  • Fine-grained access control at repository level
  • Remote and virtual repositories for caching and combining sources
  • Vulnerability scanning and supply chain features
  • Deep integration with Google Cloud build, deploy and runtime services

Disadvantages / Trade-offs

  • Repository location cannot be changed after creation
  • Storage and network costs grow without cleanup
  • Scanning adds a separate cost and can create alert noise
  • Permissions can be complex across many repositories and projects
  • Tied to Google Cloud, so cross-cloud setups need extra design
  • Remote caches depend on upstream behavior and need monitoring
Simple Analogy

A managed warehouse saves you from building and guarding your own, but you pay rent, follow its rules and must still organize your shelves. Convenience and control come with housekeeping.

“A registry does not make software safe, but it is the place where safety can be enforced.”

18Design Patterns and Anti-patterns

Habits that make a registry an asset, and habits that make it a liability.

Patterns that work

Strong teams use one repository per format per team or environment, with clear names. They build once and promote the same image through test and production by digest, instead of rebuilding. They route public packages through remote repositories and place their private repository first in virtual repositories. They scan on push and on a schedule, and they enforce approvals with Binary Authorization for production. They give identities the lowest roles possible, set cleanup policies from the start, and keep repositories near their runtimes.

ANTI-PATTERN-01 Avoid
Problem

Production deployments pull images by a moving tag, such as one named latest.

Why It’s Harmful

The tag may point to different images over time, so two servers can run different code, and nobody can tell what is truly running or roll back reliably.

Correct Approach

Deploy by digest or immutable version tags, and keep records of which digest runs where.

ANTI-PATTERN-02 Avoid
Problem

Production artifacts are rebuilt for each environment instead of promoted from the one tested build.

Why It’s Harmful

Each rebuild can differ slightly because of changing dependencies, so what was tested is not what runs in production.

Correct Approach

Build once, store the artifact, and promote the same digest through every environment.

ANTI-PATTERN-03 Avoid
Problem

Every developer and every pipeline has the writer or administrator role on every repository.

Why It’s Harmful

A mistake or a stolen credential can overwrite or delete production artifacts, and nobody can say who did it.

Correct Approach

Grant narrow roles on specific repositories, restrict write access to pipelines, and use audit logs.

ANTI-PATTERN-04 Avoid
Problem

No cleanup policy exists, and every build is kept forever.

Why It’s Harmful

Costs grow steadily, scanning bills multiply, and finding the right artifact becomes a hunt through thousands of old versions.

Correct Approach

Define keep and delete rules, test them with a dry run, and review them regularly.

ANTI-PATTERN-05 Avoid
Problem

Builds pull base images and packages directly from public sources, with no cache or control.

Why It’s Harmful

Builds fail when the public source is down or rate limits, and malicious or changed packages enter without any checkpoint.

Correct Approach

Use remote repositories as a controlled cache, scan what passes through, and order virtual repositories so private packages win.

19Best Practices and Common Mistakes

A checklist to keep your artifact store safe, tidy and affordable.

1

Plan repository layout

Separate by format, team and environment, and choose locations near runtimes before creating anything.

2

Use least privilege access

Reader for runtimes, writer for pipelines, administrator for few people.

3

Deploy by digest

Use immutable tags or digests for production so every deployment is exact and repeatable.

4

Scan and enforce

Enable vulnerability scanning where it matters, and use approvals or policies to block unsafe images.

5

Cache public sources

Use remote repositories and combine sources with virtual repositories, private first.

6

Automate cleanup safely

Set keep and delete rules, run a dry run, and review results.

7

Keep images small and rebuild regularly

Use slim base images, and rebuild often so fixes for known flaws reach production.

8

Log, monitor and review

Enable audit logs, watch storage growth and permission changes, and review access regularly.

Mistakes beginners make most often

The first is using a moving tag in production. The second is granting broad roles for convenience. The third is forgetting cleanup policies. The fourth is putting the repository in a far away region. The fifth is neglecting permissions when migrating from Container Registry. The sixth is trusting a one-time scan forever. The seventh is letting builds fetch directly from public sources with no checkpoint.

i
Document the Layout

Keep a short page that explains each repository’s purpose, owner, retention rule and who may write to it. New team members and auditors will thank you.

20Artifact Registry Compared with Other Options

There are several places to keep images and packages, and each has its own character.

OptionWhat it isStrengthTrade-off
Artifact RegistryManaged registry inside Google Cloud for images and packagesIntegration, access control, scanning, multiple formatsTied to Google Cloud
Container RegistryOlder image-only serviceHistoric familiarityDeprecated and shut down
Public registries such as Docker HubShared public hostingHuge catalog, free for public contentRate limits, limited control, trust concerns
Self-hosted registry or artifact serverSoftware you install and run yourselfTotal control, works anywhereYou run, secure, scale and back it up
Cloud Storage bucketsGeneral file storageSimple for raw filesNo package or image protocol, no format awareness
flowchart TD
Q1{"Need to store images or packages for Google Cloud workloads?"} -->|Yes| AR["Artifact Registry"]
Q1 -->|No| Q2{"Only plain files like archives?"}
Q2 -->|Yes| GS["Cloud Storage or generic repository"]
Q2 -->|No| Q3{"Must run outside Google Cloud with full control?"}
Q3 -->|Yes| SH["Self-hosted artifact server"]
Q3 -->|No| AR
        
FIG 8 — A simple path for choosing where to store artifacts
Simple Analogy

You can rent a space in a professional warehouse, build your own, or leave goods in a public shed. A professional warehouse is the easiest and safest for most companies, while your own is best when you have special needs and the staff to run it.

Many organizations mix these. They use Artifact Registry for Google Cloud workloads, and a separate tool where they must support other clouds or special requirements, often connected through remote repositories or mirroring.

21Frequently Asked Questions

Q1What is Artifact Registry in one sentence?

It is a fully managed Google Cloud service for storing, securing and delivering container images and language packages used in building and running software.

Q2Is Artifact Registry only for Docker images?

No. It also supports Maven, npm, Python, Go, apt, yum and other formats, each in its own repository.

Q3What is the difference between standard, remote and virtual repositories?

A standard repository stores your own private artifacts. A remote repository caches artifacts from an outside source such as a public package site. A virtual repository gives one address that combines several repositories behind it, in priority order.

Q4Who can pull images from a repository?

Only identities that have a role allowing it, such as the Artifact Registry Reader role on that repository or project. Grant it to the service accounts of your clusters and services.

Q5Should I use tags or digests?

Tags are friendly but can be moved to point at different images. Digests are exact fingerprints that never change. Use digests or immutable tags for production deployments.

Q6How do I stop old images from piling up?

Create cleanup policies with keep and delete rules, test them with dry run, and then enable them. This controls cost and clutter automatically.

Q7Does it scan for vulnerabilities?

Yes, through Artifact Analysis, which can scan images in repositories and report known vulnerabilities. Scanning can be turned on or off per repository, and it carries its own charges.

Q8Can I change a repository’s location later?

No. The location is chosen when the repository is created. To move, create a new repository in the desired location and copy the artifacts.

Q9What happened to Container Registry?

It was deprecated and shut down, and Artifact Registry is the recommended replacement. Artifact Registry can host repositories that answer the old gcr.io domain, so existing addresses can keep working after migration.

Q10Can private machines pull images without internet access?

Yes, using Private Google Access or private connectivity options, so traffic stays on Google’s network instead of the public internet.

Q11How is Artifact Registry priced?

Mainly by the amount of storage used and by network traffic that leaves a location, with a small free allowance. Scanning is billed separately. Check the official pricing page for current rates.

Q12How does it help with supply chain security?

By offering private, access-controlled storage, vulnerability scanning, immutable tags, remote repositories as controlled caches, audit logs and integration with Binary Authorization, which can block unapproved images from running.

22Summary and Key Takeaways

Artifact Registry is Google Cloud’s managed home for container images and software packages. Builds push artifacts into repositories, scanners and policies inspect them, and runtimes pull them with narrowly granted permissions. Standard, remote and virtual repositories let you keep private artifacts, cache public ones and give developers a single address. Success comes from sensible repository layout, least privilege access, deployment by digest, scanning and approvals, regular cleanup and attention to location and cost.

Key Takeaways

  • One managed store — images and many package formats live in repositories inside your project, with no servers to run.
  • Three repository modes — standard for private artifacts, remote for caching public sources, virtual for combining them behind one address.
  • Least privilege access — readers for runtimes, writers for pipelines, few administrators, granted at repository level.
  • Deploy exactly what you tested — build once, promote by digest or immutable tag, and avoid moving tags in production.
  • Protect the supply chain — scanning, provenance, approvals with Binary Authorization, and controlled caches for public packages.
  • Clean up from day one — keep and delete rules with a dry run protect cost and keep repositories tidy.
  • Place near runtimes and plan migration — choose locations carefully, since they cannot change, and move off Container Registry with permissions mapped.