You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Google Cloud Artifact Registry is a fully managed, universal package repository for storing, managing, and securing build artefacts and dependencies. It is the successor to Container Registry (GCR) and supports multiple artefact formats — Docker containers, language-specific packages, and OS packages — in a single, unified service.
Artifact Registry replaces the older Container Registry with a more capable and secure service:
| Feature | Container Registry (GCR) | Artifact Registry |
|---|---|---|
| Formats | Docker only | Docker, Maven, npm, Python, Go, Apt, Yum, Helm, KubeFlow |
| Repository model | Per-project, per-region | Named repositories with fine-grained IAM |
| IAM | Bucket-level (GCS-based) | Repository-level and artefact-level |
| Vulnerability scanning | Basic | Integrated with Container Analysis and Binary Authorization |
| Cleanup policies | Manual | Automated cleanup policies |
| Virtual repositories | Not supported | Supported (aggregate multiple repos) |
| Remote repositories | Not supported | Supported (proxy external registries) |
Standard repositories store artefacts that you upload:
# Create a Docker repository
gcloud artifacts repositories create my-docker-repo \
--repository-format=docker \
--location=europe-west1 \
--description="Production Docker images"
# Create an npm repository
gcloud artifacts repositories create my-npm-repo \
--repository-format=npm \
--location=europe-west1 \
--description="Internal npm packages"
# Create a Python repository
gcloud artifacts repositories create my-python-repo \
--repository-format=python \
--location=europe-west1 \
--description="Internal Python packages"
Remote repositories proxy external registries, caching artefacts locally:
# Create a remote repository that proxies Docker Hub
gcloud artifacts repositories create dockerhub-cache \
--repository-format=docker \
--location=europe-west1 \
--mode=remote-repository \
--remote-repo-config-desc="Docker Hub cache" \
--remote-docker-repo=DOCKER-HUB
Virtual repositories aggregate multiple repositories under a single endpoint:
# Create a virtual repository
gcloud artifacts repositories create my-virtual-repo \
--repository-format=docker \
--location=europe-west1 \
--mode=virtual-repository
# Configure Docker to authenticate with Artifact Registry
gcloud auth configure-docker europe-west1-docker.pkg.dev
# Tag a local image for Artifact Registry
docker tag my-app:latest \
europe-west1-docker.pkg.dev/my-project/my-docker-repo/my-app:v1.0.0
# Push the image
docker push \
europe-west1-docker.pkg.dev/my-project/my-docker-repo/my-app:v1.0.0
# Pull an image from Artifact Registry
docker pull \
europe-west1-docker.pkg.dev/my-project/my-docker-repo/my-app:v1.0.0
LOCATION-docker.pkg.dev/PROJECT_ID/REPOSITORY/IMAGE:TAG
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.