World map

 

BM: Baca dalam Bahasa Melayu

World D1: First Containers

Tags and the latest trap

You will learn: what a tag is, and why latest can surprise you.

Checked with Docker Engine 29 on 31 Oct 2026

The problem

Aina ran docker run nginx in January. Ben ran the same line today. They got different versions of nginx! How?

Pick one answer.

Watch

docker pull nginx prints Using default tag: latest, then pulls nginx:latest. docker images now lists nginx:1.30-alpine and nginx:latest side by side. Docker transcript: $ docker pull nginx Using default tag: latest latest: Pulling from library/nginx 6fc242d221a6: Pull complete a071113ac575: Pull complete 9f604dae09b2: Pull complete 6e2ab1f3ef4e: Pull complete c139fe92686d: Pull complete d322f1bf41d8: Pull complete a670537bed70: Pull complete Digest: sha256:5ab5b0b01097420873a3f3330f44248e34a3c2a3e8d5ee30658aeae8cb7435da Status: Downloaded newer image for nginx:latest docker.io/library/nginx:latest $ docker images i Info → U In Use IMAGE ID DISK USAGE CONTENT SIZE EXTRA alpine:3.22 2e0b81d60597 12.9MB 3.88MB nginx:1.30-alpine 0e52bd054126 93.5MB 27MB nginx:latest 5ab5b0b01097 243MB 66.8MB

Your laptop~

  • No open hatches

Lunchboxes (containers)

  • No containers yet

Frozen packs (images)

  • alpine:3.221 layers · 12.9MB
  • nginx:1.30-alpine8 layers · 93.5MB

0 containers (0 running), 2 images, 0 lockers.

A tag: The label after the colon, like nginx:1.30-alpine. No tag means :latest. is the label after the colon, like 1.30-alpine. No tag? Docker says Using default tag: latest.

Try it

Which labels could suddenly give you a new version?

Drag a card into a box. Or tap the card, then tap the box.

      Predict

      Is latest: Just the default tag name. Its makers can move it to a new version any day. always the newest, safest version?

      Pick one answer.

      Check

      Two boxes, both nginx. pinned answers Server: nginx/1.30.6. newest, from latest, answers Server: nginx/1.31.8. Docker transcript: $ docker run -d --name pinned -p 8080:80 nginx:1.30-alpine 2f1e4458ce8eeb100f4beb4a2a42307bc50f70777b97668cd744a843fd5270df $ docker run -d --name newest -p 8081:80 nginx Unable to find image 'nginx:latest' locally latest: Pulling from library/nginx 6fc242d221a6: Pull complete a071113ac575: Pull complete 9f604dae09b2: Pull complete 6e2ab1f3ef4e: Pull complete c139fe92686d: Pull complete d322f1bf41d8: Pull complete a670537bed70: Pull complete Digest: sha256:5ab5b0b01097420873a3f3330f44248e34a3c2a3e8d5ee30658aeae8cb7435da Status: Downloaded newer image for nginx:latest 5e58aeadbf439542332dc96b9b89c8c3cab36fa6762c85b2147fbed0479af324 $ curl -sI localhost:8080 | grep Server Server: nginx/1.30.6 $ curl -sI localhost:8081 | grep Server Server: nginx/1.31.8

      Your laptop~

      • No open hatches

      Lunchboxes (containers)

      • No containers yet

      Frozen packs (images)

      • alpine:3.221 layers · 12.9MB
      • nginx:1.30-alpine8 layers · 93.5MB

      0 containers (0 running), 2 images, 0 lockers.

      Two boxes, both “nginx”. One answers 1.30.6, the other 1.31.8. You tested one, but production got the other. That is the latest trap.

      Try it

      Your turn. Run web from a pinned tag: nginx 1.30 on Alpine. No surprise jumps.

      Your laptop~

      • No open hatches

      Lunchboxes (containers)

      • No containers yet

      Frozen packs (images)

      • alpine:3.221 layers · 12.9MB
      • nginx:1.30-alpine8 layers · 93.5MB

      0 containers (0 running), 2 images, 0 lockers.

      Check

      docker pull nginx:9.9 fails: failed to resolve reference, nginx:9.9 not found. Docker transcript: $ docker pull nginx:9.9 Error response from daemon: failed to resolve reference "docker.io/library/nginx:9.9": docker.io/library/nginx:9.9: not found

      Your laptop~

      • No open hatches

      Lunchboxes (containers)

      • No containers yet

      Frozen packs (images)

      • alpine:3.221 layers · 12.9MB
      • nginx:1.30-alpine8 layers · 93.5MB

      0 containers (0 running), 2 images, 0 lockers.

      A tag that doesn’t exist? The real error ends with nginx:9.9: not found. Plain words: the freezer has no pack with that label.

      You did it!

      You can now pick tags on purpose and dodge the latest trap.

      Go deeper (optional)

      Even 1.30-alpine gets small fixes, so the pack can still change a little. To freeze one exact pack, use its digest: nginx@sha256:…. World D5 covers digests. One rule for now: never latest in production.

      Real rep (optional):

      Real mission

      1. docker pull nginx:1.30-alpine
      2. docker images nginx

      0 of 3 steps done · Your ticks are saved.