gcloud artifacts repositories create: Usage & CI Errors
Create an Artifact Registry repository for Docker, npm, Maven, or more.
gcloud artifacts repositories create provisions an Artifact Registry repository - Google’s successor to Container Registry - to store container images or language packages used by your pipelines.
What it does
The command creates a repository of a given --repository-format (docker, npm, maven, python, apt, yum) in a --location. For Docker, you then authenticate Docker to the registry host with gcloud auth configure-docker <region>-docker.pkg.dev before pushing images.
Common usage
# Create a Docker repository
gcloud artifacts repositories create my-repo \
--repository-format=docker \
--location=us-central1 \
--description="App images"
# Configure Docker to push to it
gcloud auth configure-docker us-central1-docker.pkg.devCommon error in CI: "denied: Permission ... denied on docker push" / wrong host
After creating the repo, docker push fails with "denied: Permission \"artifactregistry.repositories.uploadArtifacts\" denied" or "unauthorized" because Docker was never pointed at the Artifact Registry host. Fix: run gcloud auth configure-docker <region>-docker.pkg.dev (note the per-region host, e.g. us-central1-docker.pkg.dev - not gcr.io) so credentials are wired into Docker’s config, and grant the pushing identity roles/artifactregistry.writer. The full image path is <region>-docker.pkg.dev/PROJECT/REPO/IMAGE:TAG.
Key options
| Option | Purpose |
|---|---|
| --repository-format | docker, npm, maven, python, apt, yum |
| --location | Region (e.g. us-central1) |
| --description | Human-readable description |
| gcloud auth configure-docker HOST | Wire Docker auth to the registry |