Skip to the workspace
Pebellslearn by building
Basics of Docker  ›  Lesson

Image Names and Tags

Basics of Docker 12 minA full image name is registry, namespace, repository and tag, and Docker fills in docker.io, library and latest for any part you leave out.

docker / Image Names and Tags

Explore each scene at your own pace.

01 · The rule

The rule

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:latest

Two commands help you see what you have:

docker pull postgres:16
docker images

docker 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:….

Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.