Container Registries: ACR and Artifact Registry
Every cloud has a private OCI registry next to its compute, with identity-based pulls, vulnerability scanning and replication. ECR maps to Azure Container Registry (ACR) and to Google's Artifact Registry, which also stores language packages (npm, Maven, Python, Go) and OS packages.
On AWS this is… Amazon ECR, from Containers: ECS, EKS, Fargate, ECR. For signing and scanning in depth, see Software Supply Chain Security.
Side by side
| AWS ECR | Azure Container Registry | Google Artifact Registry | |
|---|---|---|---|
| Unit | registry per account and region, repositories inside | registry (global name acrshopprod.azurecr.io), repositories created on push |
repository per location and format, in a project |
| Image path | 111122223333.dkr.ecr.eu-west-1.amazonaws.com/shop/api:1.4.2 |
acrshopprod.azurecr.io/shop/api:1.4.2 |
europe-west1-docker.pkg.dev/shop-prod-4821/shop/api:1.4.2 |
| Tiers | one | Basic, Standard, Premium (Premium: geo-replication, private endpoints, more throughput) | one (pricing by storage and egress) |
| Login | aws ecr get-login-password | docker login … |
az acr login -n acrshopprod |
gcloud auth configure-docker europe-west1-docker.pkg.dev (credential helper) |
| Pull from managed K8s | node IAM role / Pod Identity | az aks update --attach-acr (grants AcrPull to the kubelet identity) |
node service account with roles/artifactregistry.reader (same project works by default) |
| Build in the cloud | CodeBuild | ACR Tasks (az acr build) |
Cloud Build (gcloud builds submit) |
| Other formats | — (CodeArtifact is separate) | Helm charts and OCI artifacts | npm, Maven, Python, Go, apt, yum, Helm, generic |
| Proxy upstreams | pull-through cache | artifact cache rules | remote repositories (Docker Hub, PyPI, …) and virtual repositories |
| Replication | cross-region replication rules | geo-replication (Premium) | multi-region locations (europe, us, asia) |
| Immutable tags | yes | locks on images (--write-enabled false) |
immutable tags setting per repository |
Google's older Container Registry (gcr.io) has been shut down; gcr.io hostnames are now served by Artifact Registry repositories. If you find gcr.io/... in old manifests, the images live in Artifact Registry now, under the newer *.pkg.dev model or gcr.io repositories.
Model: building image references
Image paths are the most-copied, most-mistyped strings in a pipeline. A helper that builds them from the same inputs:
def image_ref(cloud, repo, image, tag, **ctx):
if cloud == "aws":
host = f"{ctx['account']}.dkr.ecr.{ctx['region']}.amazonaws.com"
return f"{host}/{repo}/{image}:{tag}"
if cloud == "azure":
return f"{ctx['registry']}.azurecr.io/{repo}/{image}:{tag}"
if cloud == "gcp":
return f"{ctx['location']}-docker.pkg.dev/{ctx['project']}/{repo}/{image}:{tag}"
raise ValueError(cloud)
refs = [
image_ref("aws", "shop", "api", "1.4.2", account="111122223333", region="eu-west-1"),
image_ref("azure", "shop", "api", "1.4.2", registry="acrshopprod"),
image_ref("gcp", "shop", "api", "1.4.2", location="europe-west1", project="shop-prod-4821"),
]
for r in refs:
host, _, path = r.partition("/")
print(f"{host:<45} {path}")111122223333.dkr.ecr.eu-west-1.amazonaws.com shop/api:1.4.2
acrshopprod.azurecr.io shop/api:1.4.2
europe-west1-docker.pkg.dev shop-prod-4821/shop/api:1.4.2
In Artifact Registry, the first path segment after the host is the project, then the repository (shop), then the image. In ACR and ECR, shop/api is just a repository name with a slash in it.
Push and pull
Azure, sample session:
az acr create -g rg-shop-prod-app -n acrshopprod --sku Premium --admin-enabled false
az acr login -n acrshopprod
docker tag shop-api:1.4.2 acrshopprod.azurecr.io/shop/api:1.4.2
docker push acrshopprod.azurecr.io/shop/api:1.4.2
az acr build -r acrshopprod -t shop/api:1.4.3 . # build in Azure, no local Docker needed
az acr repository show-tags -n acrshopprod --repository shop/api -o table
az aks update -g rg-shop-prod-app -n aks-shop-prod --attach-acr acrshopprod--admin-enabled false keeps the registry's shared admin username/password off; use Entra identities (AcrPush for CI, AcrPull for runtimes).
Google Cloud, sample session:
gcloud artifacts repositories create shop --repository-format=docker \
--location=europe-west1 --description="shop images"
gcloud auth configure-docker europe-west1-docker.pkg.dev
docker tag shop-api:1.4.2 europe-west1-docker.pkg.dev/shop-prod-4821/shop/api:1.4.2
docker push europe-west1-docker.pkg.dev/shop-prod-4821/shop/api:1.4.2
gcloud builds submit --tag=europe-west1-docker.pkg.dev/shop-prod-4821/shop/api:1.4.3 .
gcloud artifacts docker images list europe-west1-docker.pkg.dev/shop-prod-4821/shop --include-tagsSample output of the last command:
IMAGE DIGEST TAGS CREATE_TIME UPDATE_TIME
europe-west1-docker.pkg.dev/shop-prod-4821/shop/api sha256:4f2a9c1e0b7d8a6f3e5c2b1a0d9e8f7c6b5a4d3e2f1a0b9c8d7e6f5a4b3c2d1e 1.4.2 2026-10-26T09:12:40 2026-10-26T09:12:40
europe-west1-docker.pkg.dev/shop-prod-4821/shop/api sha256:9b8a7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8b 1.4.3 2026-10-26T10:03:15 2026-10-26T10:03:15Scanning and cleanup
- Scanning: Microsoft Defender for Containers scans ACR images; Artifact Registry uses Artifact Analysis (on-push and continuous scanning, enabled per project). Both are paid features; check current pricing. Open-source scanners from the supply chain course work against any of these registries.
- Cleanup: Artifact Registry cleanup policies (keep the N most recent versions, delete untagged after N days); ACR retention policy for untagged manifests (Premium) and
az acr runpurge tasks. Without cleanup, registries quietly grow forever. - Deploy by digest: whichever registry, deploy
…@sha256:digests rather than tags in production.
Test yourself
In europe-west1-docker.pkg.dev/shop-prod-4821/shop/api:1.4.2, what is shop?
- The project
- The Artifact Registry repository
- The image tag
- The region
What does az aks update --attach-acr acrshopprod do?
- Copies images into the cluster
- Grants the cluster's kubelet identity AcrPull on the registry
- Enables the admin account
- Creates a pull secret in every namespace
What happened to Google Container Registry (gcr.io)?
- It is the recommended registry
- It has been shut down; gcr.io is served by Artifact Registry
- It only stores Helm charts
- It moved to Azure