Sub topic 14
Other registry options
This chapter assumes you can build and push an image, you know the parts of an image reference (host, repository, tag, digest), and you have seen docker login in the GHCR and ECR chapters. Here you will see the other registries you are likely to meet and how they differ from the two covered in depth.
What stays the same
Every registry that follows the OCI Distribution specification speaks the same protocol. Moving between them changes three things: the host name, how you obtain credentials, and the extra features the vendor adds. The commands docker tag, docker push, and docker pull work the same way everywhere.
Common alternatives
| Registry | Host pattern | Typical login method | Notable traits |
|---|---|---|---|
| Docker Hub | `docker.io` (the default host) | Username and access token | Largest public catalog. Free accounts have pull rate limits. |
| Azure Container Registry (ACR) | `NAME.azurecr.io` | `az acr login`, service principal, or managed identity | Integrates with Microsoft Entra ID and Azure Kubernetes Service. |
| Google Artifact Registry | `REGION-docker.pkg.dev` | `gcloud auth configure-docker`, service account | Also stores language packages, not only images. |
| Harbor | Your own host name | Username and password, or robot accounts | Open source and self-hosted. Includes scanning, replication, and project quotas. |
| Self-hosted `registry` image | Your own host name | Basic auth or a reverse proxy | Minimal. You manage storage, TLS, and cleanup. |
Docker Hub
Docker Hub is the default. An image name with no host, such as nginx, means docker.io/library/nginx. Private repositories exist, but the number you get depends on your plan. Anonymous and free pulls are rate limited, so CI systems that pull base images often log in or use a mirror.
Azure Container Registry and Google Artifact Registry
Both behave like ECR. Each is tied to a cloud account, uses that cloud's identity system, and hands out short-lived tokens through a CLI. The login step is the only part that differs from what you have already done:
az acr login --name myregistry
docker push myregistry.azurecr.io/my-app:1.0.0
gcloud auth configure-docker us-central1-docker.pkg.dev
docker push us-central1-docker.pkg.dev/my-project/my-repo/my-app:1.0.0The second command registers a credential helper for that host, so later pushes need no separate login.
Harbor and self-hosted registries
Harbor is a CNCF project you run yourself. It adds role-based access per project, vulnerability scanning, image signing support, and replication between registries. The plain registry image from Docker is much smaller in scope. A minimal run looks like this:
docker run -d -p 5000:5000 --name registry registry:2
docker tag my-app:latest localhost:5000/my-app:1.0.0
docker push localhost:5000/my-app:1.0.0Docker treats localhost as allowed over plain HTTP. Any other host needs TLS, and a production registry also needs authentication, backups, and garbage collection. That operating work is the main cost of self-hosting.
How the options relate
Common mistakes
- Pointing
docker loginat the wrong host. Credentials are stored per host, so a login todocker.iodoes nothing forghcr.io. - Forgetting that a cloud registry's token expires. Re-run the login step in CI on every job.
- Assuming a feature exists everywhere. Tag immutability, scanning, and replication vary by product and plan, so check each one before you rely on it.
Exercise
A teammate pushes an image to a Harbor server at registry.example.com and gets an authentication error, even though they logged in to Docker Hub earlier that day. What is the likely cause, and what should they run?
Show answer
Docker stores credentials per registry host, so the Docker Hub login does not apply to registry.example.com. They should run docker login registry.example.com with their Harbor username and password (or a robot account), then push again.