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:
- Trusted source. On Docker Hub, prefer Docker Official Images (reviewed images such as
postgres,redis,python, under the hiddenlibrarynamespace) or Verified Publisher images from the software's own vendor. Be wary of images from unknown accounts: you cannot see what was put inside. - Pinned version. Choose an explicit tag like
redis:7.2instead oflatest, so every machine runs the same version and upgrades happen when you decide. - Smallest fit. Many images come in variants. A
-slimtag drops extras from a Debian base; an-alpinetag 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. - 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-alpinedocker image inspect shows the image's settings, such as its default command, exposed ports and declared volumes, before you ever run it.