Docker Tutorial: Images, Compose & Container Networking
Learn Docker from images and layers through volumes, Compose and container networking to production images and CI. Twenty visual chapters with labs.
What you will learn
- Images, layers, the build cache and multi-stage builds
- Running containers: logs, exec, restart policies
- Environment variables, ENV and ARG
- Volumes, bind mounts and tmpfs
- Ports, container-to-container traffic and Docker DNS
- Docker Compose for local product stacks
- Networking: namespaces, bridge and veth pairs
- Networking: port publishing and NAT
- Networking: CNM, libnetwork and drivers
- Networking: host, none, macvlan, overlay and VXLAN
- Production images: non-root, healthchecks, limits, scanning
- Registries, tags and building in CI
- Troubleshooting a running container and its network
How it works
Twenty visual chapters in four stages: foundations, multi-container apps, network internals and production.
Lessons
- Ports & networking basics — EXPOSE vs -p, host port vs container port, why localhost inside a container is not your machine, and how containers reach each other.
- Docker fundamentals — What Docker is, how a container differs from a virtual machine, and what images, containers and registries are, explained simply.
- Images & containers — An image is a read-only stack of layers; a container adds one writable layer and runs a process. How layers are shared and why containers lose their changes.
- Dockerfile basics — Write a Dockerfile step by step: FROM, WORKDIR, COPY, RUN, ENV, EXPOSE, CMD vs ENTRYPOINT, and the mistakes that make images huge.
- Building images — How the layer cache works, why instruction order matters, .dockerignore, and multi-stage builds that cut image size.
- Running containers — docker run options that matter: -d, -it, --rm, -e and --name, then logs, exec, inspect and stats, and restart policies for services.
- Environment variables
- Volumes and data — Keep data when a container is removed: named volumes, bind mounts and tmpfs compared, -v vs --mount, backups, and the mistakes that hide files.
- Container-to-container communication — Container-to-container traffic on one host: same network vs different networks, by IP vs by name, and why the default bridge has no DNS.
- User-defined bridge and Docker DNS — Why containers resolve each other by name only on user-defined networks, how Docker's embedded DNS at 127.0.0.11 works, and network aliases.
- Docker Compose — Run a multi-container app from one compose.yaml: services, networks, volumes, depends_on with healthchecks, .env files and the commands you use daily.
- Namespaces and isolated stacks — Each container gets its own network namespace with its own interfaces, routes and ports. Build one by hand and see what Docker automates.
- Default bridge and veth pairs — How docker0, veth pairs and iptables connect containers on the default bridge network, traced packet by packet.
- Port publishing and NAT — What -p 8080:80 does under the hood: iptables DNAT rules, docker-proxy, binding to 127.0.0.1, and why published ports can bypass firewalls.
- The network model: CNM, libnetwork and drivers — Sandbox, endpoint and network, how libnetwork builds them, and which driver to pick: bridge, host, none, overlay, macvlan or ipvlan.
- Host, none, macvlan and ipvlan networks — Share the host's network stack, run with no network at all, or give containers their own LAN address with macvlan and ipvlan.
- Overlay networks and VXLAN — Connect containers across hosts with an overlay network: VXLAN encapsulation, the control plane, and Swarm service discovery.
- Production-ready images: users, healthchecks and limits — Make images production-ready: small base images, a non-root USER, HEALTHCHECK, memory and CPU limits, vulnerability scanning and handling secrets.
- Registries and CI: tag, push and ship — Image names, docker tag and docker push, tagging strategies, digests, multi-platform builds for Apple silicon and amd64, and building images in GitHub Actions.
- Troubleshooting, isolation and security — Debug "connection refused" and DNS failures between containers with nsenter, tcpdump and docker network inspect, then lock networks down.
More courses
- Jobs, linked to lessons — Browse jobs where every requirement links to the chapter that teaches it. See how ready you are, how long the gap takes to close, and which listings look stale.
- Match a job post to courses — Paste a job post. Each skill is matched to a track here and put in learning order, foundations first.
- React patterns from open source — Patterns extracted from Material UI, Radix, React Aria, React Hook Form, Redux Toolkit, TanStack, and Next.js — not slides about hooks.
- Databases in depth — How a query becomes work. Indexes, isolation, locks, and the plans that explain why a page is slow — not an ORM tour.
- System Design — Core concepts first (SQL vs NoSQL, CAP, indexing, replication, sharding), then designs grouped by what carries them: the database, Redis, Kafka, or many services.
- NestJS: build a real API — One ticket-booking API, built in order: a plain Node server first, then NestJS modules, validation, a real database, and the features real clients lean on.
- Microservices — Microservice patterns one diagram at a time: how to split a monolith, how services talk, and how data stays consistent without distributed transactions.
- Kafka — A beginner-to-senior path through event logs, reliable delivery, production operations, and disaster recovery.
- AI engineering for software engineers — Eight free reads, in order, for software engineers moving into AI: when to build an agent, how to build one, how to test it, and how the model works underneath.
- Frontend system design — How a UI is sliced when it is a product, not a page: ownership of state, cache, routes, and what happens when the network lies.
- TypeScript in depth — The type system as a design tool. Inference, narrowing, generics, and the errors that mean the model is wrong — not a catalog of utility types.
- CSS in depth — See the box, then the page. Visual chapters from the box model through Flexbox surprises, Grid, selectors, and units, then backgrounds, shapes, and visual effects, each with a playground.
- Accessibility — Foundations first (WCAG in plain words, semantic HTML, lists, alt text), then hands-on HTML labs, a full pass of WAI-ARIA 1.3, and a final fix-the-page challenge.
- Redis — Fifteen Redis patterns, one picture each: cache, session, lock, counter, rate limiter, queue, and when Redis is the wrong tool.
- Kubernetes — Kubernetes from zero to operators: why it exists, Pods, Deployments and Services, then configuration, networking, storage, scheduling, scaling and security.
- AWS — AWS networking in plain English. A VPC is a gated housing society: streets are subnets, the Internet Gateway is the main gate, and a route table is the signboard.
- Networking: the NetRoute game — NetRoute is a packet logistics game. You wire up computers, switches, routers, firewalls and gateways, set each device, and watch glowing packets travel. If a packet gets dropped, the game shows you which header field was wrong.