Keyboard Shortcuts N Next post
P Previous post
S Save / unsave
R Read aloud
T Toggle theme
/ Focus search
Esc Close panels
🔥
Ready to read...
Docker Docker & Containers: From Zero to Production Docker Hub Docker Images Module 2 — Docker Images

Pulling Images from Docker Hub — Tags, Versions, Digests

Reviewed & accurate
AI Summary

What You'll Learn

Beginner

  • How to search for and pull images from Docker Hub
  • The difference between tags, versions, and digests
  • How to choose the right image (official vs community)

Searching for Images

Terminalbash
# Search from the command line
docker search nginx

# Or browse https://hub.docker.com in your browser

Pulling Images

Terminalbash
# Pull the latest tag (not recommended for production)
docker pull nginx

# Pull a specific version
docker pull nginx:1.25.3

# Pull an Alpine-based variant (smaller)
docker pull nginx:alpine

# Pull by digest (immutable — always gets the exact same image)
docker pull nginx@sha256:abc123...

Tags vs Digests

TagsDigests
Human-readable labelSHA256 hash of the image
Can change over timeImmutable — never changes
nginx:1.25nginx@sha256:abc123...
When to use digests
In production, use digests for guaranteed reproducibility. nginx:1.25 might point to a different image tomorrow. A digest always points to the exact same image.

Image Variants — slim, alpine, full

TagSizeWhen to use
python:3.11~900 MBFull Debian — maximum compatibility
python:3.11-slim~150 MBStripped Debian — smaller, good default
python:3.11-alpine~50 MBAlpine Linux — smallest, may have compatibility issues

Practical Exercise

Run docker search python
Run docker pull python:3.11-slim
Run docker images — see the size
Run docker image inspect python:3.11-slim

Key Takeaways

  • docker pull <image>:<tag> downloads an image from Docker Hub.
  • Tags are human-readable but mutable. Digests (SHA256) are immutable.
  • Use official images for security. Review community images before using.
  • Variants: full (compatible), slim (balanced), alpine (smallest).
  • In production, pin versions or use digests. Avoid latest.
Previously: Lesson 09 covered image layers.
Today: You learned: Pull images, understand tags vs digests, choose the right version.
Next: Lesson 11 shows how to build your own image.
Test Your Knowledge
How did you find this?

Comments

Join the discussion! Sign in with your Google or Blogger account, or comment as Anonymous - no account needed. For quick questions, also reach me on Telegram @cytestch.

Comments