Registries Basics
A container registry stores and serves OCI images, and this page covers the everyday commands and hygiene for running private registries like Harbor, ECR, ACR, and GCR/Artifact Registry.
Search across all documentation pages
A container registry stores and serves OCI images, and this page covers the everyday commands and hygiene for running private registries like Harbor, ECR, ACR, and GCR/Artifact Registry.
You build and push with Docker; on nodes, containerd via the CRI pulls and runs those same images.
kubectl against a cluster running Kubernetes 1.36.2 (nodes use containerd via the CRI).aws, az, or gcloud.Every pull or push resolves a reference made of registry, repository, and tag or digest.
# registry-host / repository : tag
harbor.example.com/team-a/api:1.4.0
# registry-host / repository @ digest (immutable)
harbor.example.com/team-a/api@sha256:9b2c...e1@sha256: digest names exact, immutable bytes.Authenticating writes a credential the Docker client reuses for later pushes and pulls.
docker login harbor.example.com -u ci-robot
# password or token is read from stdin when piped~/.docker/config.json by default.A push uploads only the layers the registry does not already have.
docker build -t harbor.example.com/team-a/api:1.4.0 .
docker push harbor.example.com/team-a/api:1.4.0Pinning the digest removes any ambiguity about which bytes you run.
docker pull harbor.example.com/team-a/api@sha256:9b2c...e1docker buildx imagetools reads the manifest directly from the registry.
docker buildx imagetools inspect harbor.example.com/team-a/api:1.4.0linux/amd64, linux/arm64).ECR issues a temporary token that Docker uses as a password.
aws ecr get-login-password --region us-east-1 \
| docker login --username AWS --password-stdin \
123456789012.dkr.ecr.us-east-1.amazonaws.comgcloud configures Docker to use your Google credentials as a helper.
gcloud auth configure-docker us-docker.pkg.dev
docker push us-docker.pkg.dev/my-project/team-a/api:1.4.0gcr.io).Private images need a Secret referenced by the pod's imagePullSecrets.
apiVersion: v1
kind: Pod
metadata:
name: api
spec:
imagePullSecrets:
- name: harbor-creds
containers:
- name: api
image: harbor.example.com/team-a/api@sha256:9b2c...e1kubectl create secret docker-registry harbor-creds ....containerd at pull time.Registry-side policy stops tags from being overwritten and cleans old images.
# Harbor: project settings enforce these, or via API
# 1. Enable "Immutable tags" rules (for example match "v*")
# 2. Add a tag retention policy: keep last 10 pulled per repositoryScanning catches known CVEs before an image reaches production.
trivy image --severity HIGH,CRITICAL \
harbor.example.com/team-a/api:1.4.0HIGH or CRITICAL findings you have not accepted.A few habits keep a private registry secure, cheap, and reliable across Harbor, ECR, ACR, and Artifact Registry.
Stack versions: This page was written for Kubernetes 1.36.2, Docker Engine 29.6.1 (BuildKit default), containerd (CRI runtime on nodes), Helm 3, Compose v2, Argo CD (latest - verify at build), and Gateway API (GA - verify controller support at build).
Reviewed by Chris St. John·Last updated Jul 16, 2026