Docker for Software Development: Classroom Bootcamp
An eight-hour classroom bootcamp on Docker, taught on a realistic multi-container application: Smarter’s Django web server, Celery workers and scheduler, MariaDB and Redis, built from one Dockerfile and run with one Compose file. Students read, run, debug and improve it. See Course Formats and Grading for the standard bootcamp day, the grading scale and the course policies, and Docker for Software Development for an overview of the subject.
At a Glance
Students |
Developers and operations engineers who are new to containers, or who use them without understanding them. |
Deployment |
Each student clones the repository and runs it with Docker Desktop (or Docker Engine on
Linux). The first |
Cost |
Free. Labs need no model provider calls beyond a single test chat. |
Learning Objectives
By the end of the bootcamp, students can:
Explain images, layers, containers, volumes, networks and registries.
Read a multi-stage Dockerfile, and explain what each instruction does and why.
Run and debug a multi-container application with Docker Compose, using
exec,logs,statsandinspect.Explain why one image can run as a web server, a worker and a scheduler, and how configuration reaches it.
Improve an image’s size, build time or security, and measure the result.
Technical Prerequisites
Required: the Linux or macOS command line: navigating directories, files and permissions, environment variables, processes, and a text editor.
Required: Git: clone and pull.
Required: Docker Desktop installed, with at least 8 GB of memory allotted to it, and
make initandmake runcompleted from the repository before the bootcamp (see Developer Setup Guide).Required: reading YAML.
Helpful: reading Python or another scripting language, and basic networking (ports, DNS, localhost).
Schedule
Block |
Min |
Content |
|---|---|---|
1 |
45 |
Lecture 1: Why containers. “It works on my machine”, virtual machines versus containers, images, layers, containers and registries. Smarter’s containers, and ADR 002 on Docker. |
2 |
45 |
Lab 1: Look inside. With |
3 |
45 |
Lecture 2: The Dockerfile. Instructions, the build cache, multi-stage builds, and a walk
through Smarter’s |
4 |
45 |
Lab 2: Annotate the Dockerfile. Annotate every stage and instruction: what it does, why it is there, and what would break without it. Produces Assignment 2. |
5 |
45 |
Lecture 3: Compose. Services, networks, volumes, environment files, health checks and
dependencies, through Smarter’s |
6 |
45 |
Lecture 4: One image, many roles. Why the web server, the workers and the scheduler run from the same image with different commands. Configuration through the environment, and ADR 004 on the twelve-factor app. |
7 |
45 |
Lab 3: Follow a request. Send a chat message, and follow it from the web server to a
Celery worker and back with |
8 |
45 |
Lecture 5: Images that are small, fast and safe. Layer ordering for caching, slim base
images, |
9 |
45 |
Lab 4: Measure an image. Explore Smarter’s image layers with |
10 |
45 |
Lecture 6: From Compose to production. Development versus production images, the lack of a bind mount in Smarter’s setup and its trade-offs, registries, and why Kubernetes comes next. |
11 |
30 |
Capstone kickoff. Students choose a capstone and plan it. |
Graded Assignments
Assignment 1: Container Inventory
Students produce an inventory of the running Smarter containers: image, command, user, exposed ports, volumes, networks and the main process of each.
Turn in: a table and the commands used to fill it in.
Criterion |
Pts |
Exemplary |
Developing |
|---|---|---|---|
Completeness |
8 |
Every container and every column filled in correctly. |
Gaps or errors. |
Method |
6 |
Uses |
Copied from the Compose file. |
Observations |
4 |
Notes which containers share an image and why. |
None. |
Clarity |
2 |
Easy to read. |
Disorganized. |
Assignment 2: Annotated Dockerfile
Students annotate Smarter’s Dockerfile: what each stage does, why the application runs as a
non-root user, and three ways the image could be made smaller or faster to build.
Turn in: the annotated Dockerfile (comments added) in their fork.
Criterion |
Pts |
Exemplary |
Developing |
|---|---|---|---|
Accuracy |
8 |
Every stage and instruction explained correctly. |
Several explanations wrong. |
Reasoning |
5 |
Explains why, not only what, including the non-root user. |
Restates the instruction. |
Improvements |
5 |
Three realistic improvements, with expected effect. |
Generic advice. |
Observation |
2 |
Notes that the stages form a single chain, and what a separate build stage would change. |
Not noticed. |
Assignment 3: Request Trace
Students follow one chat request through the containers, with log lines and Redis activity as evidence, and explain why the same image appears in every step.
Turn in: a sequence diagram with the evidence.
Criterion |
Pts |
Exemplary |
Developing |
|---|---|---|---|
Trace |
8 |
Every hop between containers shown. |
Hops missing. |
Evidence |
6 |
Log lines and Redis commands for each hop. |
Inferred. |
Explanation |
4 |
Explains the one-image, many-roles design. |
Not addressed. |
Diagram |
2 |
Clear. |
Cluttered. |
Capstone Projects
Students choose one. Capstones are due one week after the bootcamp.
Capstone A: A Leaner, Safer Image
Learning objective. Improve a real production image, and prove the improvement with measurements.
Students make one or more changes to Smarter’s Dockerfile on their fork, for example a separate
build stage so that compilers do not ship, better layer ordering, or a tighter .dockerignore,
and measure image size, build time (cold and cached) and vulnerability count before and after.
What students turn in:
A pull request against their fork with the changes.
A before-and-after table of size, build times and Trivy findings, with the commands used.
Evidence that the application still works: the containers start and a test chat succeeds.
A one-page explanation.
How it is graded (100 points):
Criterion |
Pts |
Exemplary |
Developing |
|---|---|---|---|
Improvement |
25 |
A meaningful, measured gain. |
Marginal or unmeasured. |
Measurement |
25 |
Repeatable measurements of size, build time and vulnerabilities. |
One measurement, or not repeatable. |
Still works |
20 |
All containers healthy; chat works. |
Breaks a role (for example the worker). |
Dockerfile quality |
15 |
Readable, commented, passes Hadolint. |
Hard to follow. |
Explanation |
15 |
Explains each change and its trade-off. |
Lists changes only. |
Capstone B: Containerize Your Own Application
Learning objective. Apply the patterns learned from Smarter to a new application, from Dockerfile to Compose.
Students containerize an application of their own (or an open source one) that has at least a web process, a background worker or scheduled job, and a database, following Smarter’s patterns: one image for several roles, a non-root user, configuration through the environment, and health checks.
What students turn in:
A Git repository with the application,
Dockerfile,docker-compose.yml,.dockerignoreand aREADME.md.A short recording of
docker compose upand the application working.A one-page note comparing their choices with Smarter’s.
How it is graded (100 points):
Criterion |
Pts |
Exemplary |
Developing |
|---|---|---|---|
Works |
25 |
Starts from a clean clone with one command. |
Needs manual steps. |
Dockerfile |
20 |
Multi-stage, non-root, cache-friendly. |
Single stage, runs as root. |
Compose |
20 |
Health checks, dependencies, volumes, environment file. |
Services only. |
Twelve-factor configuration |
15 |
No secrets in images or the repository. |
Secrets baked in. |
Documentation |
20 |
Clear |
Missing. |
Recommended Texts
Pre-reading: Docker’s getting started guide.
Reference: Nigel Poulton, Docker Deep Dive (latest edition, self-published).
Reference: The Twelve-Factor App.
Smarter documentation: Docker, ADR-002: Docker and ADR-004: 12-Factor App.
Further Study
Official documentation: Docker’s getting started guide, its building best practices, the Dockerfile reference and the Compose file reference.
Principles: The Twelve-Factor App, the short manifesto that most container practice follows.
Tools: Hadolint for linting Dockerfiles, dive for exploring image layers, and Trivy for scanning images for known vulnerabilities.
YouTube: TechWorld with Nana, for clear introductions to Docker and the tools around it, and the Docker channel’s DockerCon talks.
Podcasts: The Kubernetes Podcast from Google, which often covers container runtimes and images, and Software Engineering Radio.
Practice: Play with Docker, a free browser-based sandbox, for students whose laptops cannot run Docker.