Skip to the workspace
Pebellslearn by building
Using Third-Party Images  ›  Lesson

Choosing Images You Can Trust

Using 3rd Party Container Images 12 minPrefer official or verified images, pin a specific version tag, choose a small variant when it fits, and read the image's documentation before you run it.

docker / Choosing Images You Can Trust

Explore each scene at your own pace.

01 · The rule

The rule

Choosing Images You Can Trust

quicknotes is about to gain a cache, and a quick registry search for "redis" returns hundreds of images. Some are maintained by experts and rebuilt whenever a security fix lands. Others were uploaded once by a stranger and never touched again. Running an image means running someone else's software on your machine, so choosing well is a real skill.

The rule

Trusted source, pinned version, smallest fit, docs read.

Four checks, in order:

  1. Trusted source. On Docker Hub, prefer Docker Official Images (reviewed images such as postgres, redis, python, under the hidden library namespace) or Verified Publisher images from the software's own vendor. Be wary of images from unknown accounts: you cannot see what was put inside.
  2. Pinned version. Choose an explicit tag like redis:7.2 instead of latest, so every machine runs the same version and upgrades happen when you decide.
  3. Smallest fit. Many images come in variants. A -slim tag drops extras from a Debian base; an -alpine tag uses the tiny Alpine Linux. Smaller images download faster and contain fewer parts that could have vulnerabilities. But Alpine uses a different C library (musl), which occasionally breaks software built for Debian, so test before switching.
  4. Docs read. An image's page tells you its ports, the environment variables it expects, and where it stores data. Skipping it is how people lose databases.
docker pull redis:7.2-alpine
docker image inspect redis:7.2-alpine

docker image inspect shows the image's settings, such as its default command, exposed ports and declared volumes, before you ever run it.

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