Skip to main content
In this lesson we’ll cover Docker image tags: what they mean, how to choose versions when running containers, and best practices for reproducible deployments. Topics include the default latest tag, pulling specific versions, listing local images, removing tags, and pinning by tag or digest.

Default behavior: latest

If you run an image without a tag, Docker uses the latest tag by default. This is a convention maintained by image authors and usually points to what they consider the current release. Example (omitting a tag):
To run a specific version, append the tag after a colon:
Every distinct tag or digest you pull creates a separate image reference on the host. Image layers are shared where possible, so disk usage won’t necessarily be the sum of each image’s listed size.
To discover available tags and what latest points to for a specific image, check the image’s repository page on Docker Hub — it lists all supported tags, variants (like -alpine), and their meanings.

Listing and removing images

To view all images stored locally:
To remove a specific tag reference:
Note: docker rmi removes only the tag reference. The image layers are deleted only when no other tags or containers (running or stopped) reference them.

Tag forms and examples

Common ways you will see tags used: For absolute immutability use a digest (for example redis@sha256:...). This ensures you pull the exact same image manifest every time. See Docker docs for pulling by digest: https://docs.docker.com/engine/reference/commandline/pull/#pull-an-image-by-digest

Quick command reference

Do not rely on latest in production. Always specify an explicit, immutable tag (for example redis:7.4-alpine or redis:8.6.1), or pin to a digest, to ensure reproducible builds and predictable deployments.

Best practices

  • Pin images in production manifests to specific tags or, preferably, digests to avoid accidental upgrades.
  • Use variant tags (e.g., -alpine) if you need smaller images or a different base image.
  • Keep tags consistent across CI/CD and deployment manifests to avoid drift.
  • Regularly review and update pinned versions as part of your release/update strategy; schedule tests before upgrading.

Watch Video