Lessons
1.Why containers: from bare metal to VMs to containers
Not startedFollow the problems that led to containers: one app per server, mismatched environments, heavy virtual machines.
Getting started · 6 steps
2.Docker architecture: CLI, daemon, API and registries
Not startedSee what the docker command really is, how it talks to dockerd, and where images come from.
Getting started · 6 steps
3.Install Docker and verify it works
Not startedSee where the engine runs on each system, then watch docker version, docker info and hello-world confirm a working setup.
Getting started · 6 steps
4.What is a container, really?
Not startedSee that a container is an ordinary Linux process, wrapped in namespaces and a cgroup.
Basics · 6 steps
5.What happens when you run docker run hello-world
Not startedFollow one command from the CLI, through the Docker socket and registry, to a container that prints and exits.
Basics · 5 steps
6.A container's life: create, start, pause, stop, remove
Not startedFollow one container through its states and see which API call changes which field.
Basics · 6 steps
7.docker exec and docker logs
Not startedSee how a second process joins a running container, and where its output and logs come from.
Basics · 6 steps
8.Detached and interactive mode: -d, -i and -t
Not startedSee what -d, -i and -t change in the create request, how a terminal is wired to a container, and how to leave without stopping it.
Basics · 6 steps
9.Cleaning up: rm, rmi and prune
Not startedSee what docker ps, rm, rmi and the prune commands ask dockerd to delete, and what system prune leaves alone.
Basics · 6 steps
10.What docker pull downloads
Not startedFollow a pull from the CLI to the registry: token, manifest, layer blobs, and the files left on disk.
Images · 6 steps
11.Dockerfile instructions: FROM, WORKDIR, COPY, RUN, EXPOSE, USER
Not startedRead one Dockerfile line by line and see what each instruction changes: a layer, or only the image's config.
Images · 6 steps
12.How docker build turns a Dockerfile into layers
Not startedWatch each Dockerfile instruction run, become a layer or only metadata, and hit or miss the cache.
Images · 6 steps
13.CMD vs ENTRYPOINT
Not startedSee how CMD and ENTRYPOINT combine into the container's command, and how docker run arguments and --entrypoint change it.
Images · 6 steps
14.ARG vs ENV: build-time and run-time variables
Not startedSee where ARG and ENV values live, which one reaches a running container, and why neither is a safe place for secrets.
Images · 6 steps
15.Multi-stage builds: compile big, ship small
Not startedBuild a Go program in one stage and copy only the binary into a small final image.
Images · 6 steps
16.overlay2: layers and copy-on-write
Not startedSee how a container's filesystem is read-only image layers plus one writable layer, and what a write or delete does.
Images · 6 steps
17.Tag and push an image to a registry
Not startedSee that a tag is only a name, then follow the push: blob checks, uploads and the manifest.
Images · 6 steps
18.Namespaces: what a container can see
Not startedLook at the pid, mount, uts and network namespaces one by one, and see what changes when a container shares the host's.
Under the hood · 6 steps
19.cgroups: limits, and why exit code 137 happens
Not startedSee memory and CPU limits written into a cgroup, then follow an out-of-memory kill to exit code 137.
Under the hood · 6 steps
20.dockerd, containerd, the shim and runc
Not startedFollow a start request down the runtime stack and see which part stays alive afterwards.
Under the hood · 6 steps
21.Signals and PID 1: why docker stop takes 10 seconds
Not startedSee what docker stop sends, why PID 1 can ignore it, and how exec form and --init fix it.
Under the hood · 6 steps
22.Bridges and veth pairs: how containers share a network
Not startedSee a Linux bridge created for shop-net, containers plugged in with veth pairs, and one packet crossing from web to api.
Networking · 6 steps
23.How -p 8080:80 reaches your container
Not startedWatch Docker add a NAT rule, then follow one TCP packet from the laptop to the web container and back.
Networking · 6 steps
24.Container DNS: how web finds api by name
Not startedFollow a name lookup to Docker's embedded DNS server and see what happens on the default bridge instead.
Networking · 6 steps
25.Network modes: bridge, none and host
Not startedCompare what a container sees with --network bridge, none and host, and what -p does in each.
Networking · 6 steps
26.Overlay networks: VXLAN between two hosts
Not startedFollow one TCP packet from a container on host A to a container on host B, wrapped in VXLAN.
Networking · 6 steps
27.Volumes vs bind mounts
Not startedCompare a Docker-managed volume with a host directory mounted into a container, and see what each one hides or fills.
Storage · 6 steps
28.Why data in a volume survives docker rm
Not startedWrite one file to the container's layer and one to a volume, remove the container, and see which one is left.
Storage · 6 steps
29.Back up and restore a volume
Not startedUse a throwaway container with two mounts to tar a volume to the host, then restore it into a new volume.
Storage · 6 steps
30.What docker compose up does
Not startedSee that Compose is a client: it turns a YAML file into the same Engine API calls you could make by hand.
Compose · 6 steps
31.depends_on and healthchecks
Not startedSee what a healthcheck runs, how its status changes, and why depends_on needs service_healthy to wait for a ready database.
Compose · 6 steps
32.Environment variables and secrets in Compose
Not startedFollow a variable from your shell into a container, see who can read it, and compare it with a secrets file.
Compose · 6 steps
33.Scaling a service: three api containers
Not startedRun three copies of api, see how DNS finds them, and learn what stops a service from scaling.
Compose · 6 steps
34.Docker Compose Watch: live updates while you code
Not startedSee how Compose watches your files and then syncs them into the container, restarts it, or rebuilds the image.
Compose · 6 steps
35.Restart policies, and what unhealthy does not do
Not startedSee how dockerd restarts a crashing container, when it gives up, and why a failing healthcheck alone restarts nothing.
Production · 6 steps
36.Resource limits: CPU, memory, swap and processes
Not startedMap each limit flag to the cgroup file the kernel enforces it with, and change limits on a running container.
Production · 6 steps
37.Hardening a container: user, read-only root, capabilities
Not startedStart from a default container and add one control per step, checking each from inside.
Production · 6 steps
38.Small images and vulnerability scanning
Not startedSee what makes an image big, why deleting files in a later layer does not shrink it, and how a scanner reads an image.
Production · 6 steps
39.Logging drivers and log rotation
Not startedFollow a log line from the container to a driver, and see how rotation and the host-wide default are set.
Production · 6 steps
40.From Compose to Swarm to Kubernetes
Not startedSee which ideas carry over when one host becomes a cluster, and that the container stack underneath stays the same.
Production · 6 steps
41.A CI/CD pipeline with Docker
Not startedFollow one commit through build, test, scan, push and deploy, and see why images are tagged with the commit id.
Production · 6 steps