Distribute Images with a Registry
Overview
A registry stores image layers and serves them to Docker clients. Docker Hub is a public registry and can also host private repositories. A private company registry might enforce access policies and internal networking.
Detailed Notes
Build, tag and push
docker build -t my-app:1.0 .
docker login
docker tag my-app:1.0 username/my-app:1.0
docker push username/my-app:1.0
docker login authenticates the local Docker CLI. The first login stores credentials through Docker Desktop or a credential helper; do not print passwords in scripts.
docker tag does not copy image content immediately. It creates another local reference for the same image ID.
docker push uploads missing image layers and the manifest. A server can now pull:
docker pull username/my-app:1.0
docker run --rm username/my-app:1.0
Versioning example
| Reference | Meaning |
|---|---|
my-app:latest | Mutable convenience pointer |
my-app:1.0.2 | Release version |
my-app:sha-3ac12f | Traceable source revision |
my-app@sha256:... | Exact immutable image digest |
Production systems should record the digest or build commit alongside the human-readable tag.
Images move from source code through CI and into runtime environments.
Common Interview Questions
Finished this lesson?
0 of 27 lessons done · 0% of the course

