Docker Mastery#
Understand containers through stories and hands-on labs: Docker architecture, images and containers, Dockerfiles, port mapping, volumes and practical tasks.
How each session works#
The big idea: the topic in plain words, with an everyday example.
A picture: a diagram of the idea.
Real commands: every command was run on Docker 28 and the output you see is what it printed.
Common mistakes: what trips beginners up.
Hands-on exercises: try first, then open the solution.
Practice: a quiz for the session.
Tip
You need Docker installed and running (docker version should show a client and a server). Work in a
scratch folder, and clean up with docker rm -f NAME when an exercise is done.
Sessions
- Session 1 · Why containers? Virtual machines versus containers
- Session 2 · How Docker is built: client, daemon, registry
- Session 3 · Images, containers and registries
- Session 4 · Running your first containers
- Session 5 · Background containers, names, logs and inspect
- Session 6 · Port mapping and a real web server
- Session 7 · Writing a Dockerfile
- Session 8 · Volumes: keeping data safe
Original stories (reference)
- Virtual Machine and The Grand House
- The Tale of Magic Kitchen : A Docker Architecture
- Virtual Machine vs Containers
- The Digital Tea Kadai – Client Server Architecture & Docker
- The Bakery, Recepies, Dough & Cookies – Registry, Repository, Images, Containers
- Running ‘Hello, World!’ with BusyBox: A Docker Adventure
- Diving Deeper into Docker with Detached Mode, Naming, and Inspections
- Tomcat: Exploring Docker Port Mapping and Logs
- The Building Blocks – Detailed Structure of a Dockerfile
- Docker Volumes Explained: A Quick Guide
Docker Tasks
- Pull the nginx image from Docker Hub and run it as a container. Map port 80 of the container to port
- Create a Dockerfile for a simple Node.js application that serves “Hello World” on port 3000.
- Run a container from the ubuntu image and start an interactive shell session inside it.
- Create a Dockerfile for a Go application that uses multi-stage builds to reduce the final image size
- Create a Docker volume and use it to persist data for a MySQL container.
- Add a health check to a Docker container running a simple Node.js application.