0 / 11 lessons — 0%
Lesson 04 / 11
Docker Hub & registries
When you run docker pull nginx, that image has to come from somewhere — by default, Docker Hub, a public registry of images. Think of it like an app store, except the "apps" are pre-built environments instead of installers.
Image names follow a predictable shape:
[registry/]namespace/repository[:tag] # examples nginx # official image, "library" namespace implied, tag defaults to :latest bitnami/postgresql:16 # someone's namespace, explicit tag ghcr.io/myorg/myapp:1.4.2 # a different registry entirely (GitHub's)
Tags aren't magic — they're just labels someone attached to a specific image build. :latest is not "the newest and greatest," it's just whatever the maintainer last pushed without a specific tag. Treat it with suspicion in anything you deploy.
# build and tag your own image docker build -t yourdockerhubuser/myapp:1.0 . # log in, then push it up to the registry docker login docker push yourdockerhubuser/myapp:1.0 # anyone (or any server) can now pull it docker pull yourdockerhubuser/myapp:1.0
Private registries: most teams don't push to public Docker Hub — they run a private registry (AWS ECR, Azure ACR, GitHub Container Registry, or self-hosted). The commands are identical; only the registry hostname in the image name changes.
Try it yourselfRun
docker pull python:3.12 then docker pull python:3.12-slim, and compare their sizes with docker images. Same Python, wildly different size — that's the whole game of picking base images.