Image Names and Tags
You type docker pull postgres and something downloads. From where? Which version? A teammate's laptop pulled the "same" image last month and got a different one. Every image name hides several parts, and Docker quietly fills in the ones you leave out.
The rule
Where / who / what : which version — and Docker fills the blanks.
A full image reference has four parts:
ghcr.io / acme / quicknotes : 1.0
registry namespace repository tag- Registry: the server that stores the image. If you leave it out, Docker uses Docker Hub,
docker.io. - Namespace: the account or organisation that owns it. On Docker Hub, official images live under
library, which you never type. - Repository: the image's name.
- Tag: a label for one version. If you leave it out, Docker uses
latest.
So these pairs are identical:
docker pull postgres
docker pull docker.io/library/postgres:latestTwo commands help you see what you have:
docker pull postgres:16
docker imagesdocker images lists each local image with its repository, tag, ID and size.
Two warnings about tags. First, latest is only a default name, not a promise of "newest"; its owner can point it at a different image at any time. Second, even a tag like 16 moves as patch releases come out. For exact repeatability you can pin a digest, the content hash of one precise image: postgres@sha256:….