Docker Registry Explained
A Docker registry stores and distributes container images. This guide explains Docker Hub, private registries, image names, tags, login, push, pull, CI/CD usage, and security best practices.
What is a Docker registry?
A registry is a place where Docker images are stored. Developers and CI/CD pipelines push images to a registry, and servers or Kubernetes clusters pull images from it.
Image naming format
registry.example.com/team/app:v1.0.0 nginx:1.27 myuser/myapp:latest
Pull an image
docker pull nginx:latest
Build and tag an image
docker build -t myapp:1.0 . docker tag myapp:1.0 myuser/myapp:1.0
Login and push
docker login docker push myuser/myapp:1.0
Pull and run
docker pull myuser/myapp:1.0 docker run -d -p 3000:3000 myuser/myapp:1.0
Common registry options
- Docker Hub
- GitLab Container Registry
- GitHub Container Registry
- AWS Elastic Container Registry
- Azure Container Registry
- Google Artifact Registry
- Self-hosted private registry
CI/CD usage example
docker build -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA" . docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA"
Tagging strategy
- Tag — Use
- latest — Convenient but risky for production.
- Commit SHA — Good for traceability.
- Semantic version — Good for releases, such as v1.2.0 .
- Environment tag — Useful for dev/staging pointers.
Common mistakes
- Using only latest in production.
- Not scanning pushed images.
- Pushing secrets inside images.
- Using one shared registry account for everyone.
- Not cleaning old images and tags.
Best practices
- Use immutable tags for releases.
- Use least-privilege registry tokens.
- Scan images before deployment.
- Document image naming standards.
- Clean unused tags carefully.
Related Melochip guides
- Docker Learning Path
- GitLab Docker Build Pipeline
- Artifact Repository Managers
Official references
- Docker Hub repositories
- docker image push reference
Tag names can change; digests identify content
A tag such as latest is mutable. For reproducible deployments, record or pin the tested image digest as well as its source revision. The command fetches a public example image; it is illustrative and has not been run on your system.
docker pull alpine:3.20
docker image inspect alpine:3.20 --format '{{json .RepoDigests}}'Related Melochip guide: https://melochip.com/posts/docker-images-vs-containers-explained. Commands are illustrative and have not been independently executed.
Practical guidance and verification
A secure build-to-registry workflow
Build the image from a reviewed Dockerfile, apply an unambiguous repository name and version tag, scan the image and its dependencies, and authenticate to your approved registry with a short-lived identity where supported. Push the candidate image and verify its digest. A mutable tag such as latest can move between images, so deploying by immutable digest improves reproducibility.
Private registry permissions
Separate read-only pull credentials from publishing credentials. Avoid putting registry passwords in Dockerfiles, build arguments, shell history or CI logs. Use credential helpers or your CI platform's identity integration, configure repository retention policies, and document how compromised images are revoked. Registry access control alone does not establish that an image is safe.
Diagnose push and pull failures
For denied errors, confirm registry hostname, repository ownership, credentials, and push versus pull scopes. For manifest-not-found errors, confirm the exact tag and platform architecture. For certificate failures, correct trust configuration rather than disabling TLS verification. Inspect Docker image metadata and registry digest after the push; review the official Docker registry guidance at https://docs.docker.com/docker-hub/repos/.
Join the discussion
0 CommentsAsk questions, add context, or share what worked.
More from Melochip Editorial
Learn what Playwright testing is, why modern QA teams use it, how testers can get started, and the major types...
8 min read · Updated Nov 16, 2026
Learn how Kubernetes Deployments and ReplicaSets work with practical YAML, scaling, self-healing, rolling upda...
7 min read · Updated Nov 16, 2026
Learn Kubernetes security best practices with RBAC, Secrets, ServiceAccounts, Pod securityContext, NetworkPoli...
6 min read · Updated Nov 16, 2026Related articles
Learn Docker environment variables and secrets, including docker run -e, env files, Compose environment, secre...
3 min read · Updated Nov 16, 2026
Prepare for Docker interviews with practical questions and real-time scenarios covering images, containers, Do...
3 min read · Updated Nov 16, 2026
Learn Docker security best practices for images, containers, users, secrets, registries, scanning, least privi...
2 min read · Updated Nov 16, 2026
Troubleshoot Docker containers, logs, ports, image errors, permissions, volumes, networks, exit codes, health...
4 min read · Updated Nov 16, 2026Stay in the loop. Get new Melochip articles
Receive Melochip article updates when new articles are available. Explicit opt-in only.
No comments yet. Start the discussion.