DOCKER - 4 2 Docker Hub

This lesson is a quick tour of Docker Hub. We'll discuss how to recognise an official image, how to pick a good community image, how to read image tags and versions, and the difference between Alpine-based images and full-distro ones. The starting point is hub.docker.com. Once you're logged in, your home page lists your public and private repositories.

Spotting official images and reading tags

Search for nginx on Docker Hub: you'll find well over 100,000 results. As a rule, always start with the official image. Officials are easy to spot: the entry is labelled "Official Image" and the repo name has no slash in it. Every other image you publish lives under your account, like myaccount/nginx; only Docker's own curated set keeps the bare repo name. Official images are maintained by a small team at Docker Inc., are well documented (variables, default ports, options), and follow Dockerfile best practices in cooperation with each project's upstream team.

On the repo page you'll see tags — for instance 1.21.6, 1.21, 1, mainline, stable, latest. Tags are how images are versioned; one image can carry several tags pointing to the same underlying ID. The latest tag is special: in official repos it consistently points to the most recent release, so docker pull nginx is enough if you just want the newest version. Docker checks the local cache and only downloads what's missing.

  • docker pull nginx — newest official Nginx (latest by default, ~142 MB)
  • docker pull nginx:1.21.6-alpine — pinned version, Alpine-based (~23 MB)
  • docker image ls — see the cached images; two tags can share the same image ID

In production, always pin an explicit version rather than relying on latest — you don't want silent auto-updates. For community images, judge by stars and pull counts: a repo with millions of pulls is generally trustworthy. Click through to read their Dockerfile, check whether the source is on GitHub, and confirm the image does what you expect. The Explore tab on the top bar lists official images by category if you want to browse. To wrap up: Docker Hub is to containers what apt is to Debian packages — prefer officials, learn to spot good community alternatives, and use Alpine-based images when small footprint matters.