Docker Hands-On Labs
These Docker labs have you working with Docker, not watching it. Each lab opens a real Linux machine with Docker running and gives you a concrete job: build an image, repair a broken Dockerfile, restore a failed service, or harden a container before it ships.
What you will practice in the Docker labs
- Containers and images
- Dockerfiles and multi-stage builds
- Networks and volumes
- Docker Compose
- Health checks and resource limits
- Registries and digests
- Troubleshooting and incidents
- Security and hardening
- Backup and restore
- Multi-platform images
- Release pipeline
- 01Containers and ImagesStart lab
Run and inspect your first containers, then build a small image and publish its port.
Beginner · 20 min
- 02Identify the Container from Host EvidenceStart lab
Monitoring gives you one host PID and nothing else. Work back to the container it belongs to without restarting it.
Intermediate · 25 min
- 03Lifecycle and TroubleshootingStart lab
Two containers are down for two different reasons. Diagnose both from evidence, repair them, and drive a container through every state it has.
Intermediate · 30 min
- 04Containerize the Status APIStart lab
Take a real Node service from source code to a running, published container — writing the Dockerfile yourself.
Beginner · 35 min
- 05Repair a Fragile DockerfileStart lab
A Dockerfile that builds cleanly and is wrong five ways. Find them from the built image, not from reading, and fix them without changing what the app does.
Intermediate · 35 min
- 06Build Context and Multi-Stage ImagesStart lab
A working image that ships a build cache, a git directory and a developer's .env. Cut the context, split the build, and prove the runtime carries only what runs.
Intermediate · 40 min
- 07Build Images for Two ArchitecturesStart lab
Half your team is on arm64 laptops and the servers are amd64. Publish one image reference that serves both, find out where the emulation actually lives, then stop needing it.
Intermediate · 45 min
- 08Practical Exam A — Build a Production ImageStart lab
A repository with no container tooling and a list of production requirements. Produce a release-quality image and defend your choices. Requirements only — no procedure.
Advanced · 75 min
- 09Backup, Destroy, RestoreStart lab
Take a backup of a live PostgreSQL container, delete the container and its volume for real, and bring the data back — verified against a checksum you recorded first.
Intermediate · 40 min
- 10Fix a Volume Permission FailureStart lab
A database hardened to run non-root will not start against its mounted directory. Find the ownership mismatch and repair it without handing root back or making the data world-writable.
Intermediate · 30 min
- 11Networks and VolumesStart lab
Connect containers by name on a private bridge network, and prove data survives container replacement with a named volume.
Intermediate · 25 min
- 12Three-Zone Network SegmentationStart lab
Split an application across edge, app and data networks so a compromised gateway has no route to the database — then test the paths that are supposed to fail.
Intermediate · 35 min
- 13Restore a Failed Service PathStart lab
Three faults on one request path — a name that will not resolve, a process on the wrong address, and a port mapping to nowhere. Repair all three without flattening the network.
Intermediate · 40 min
- 14Compose the Service StackStart lab
Define the Status API plus PostgreSQL as one Compose stack: private network, named volume, environment config, and health-aware startup.
Intermediate · 60 min
- 15Overrides, Profiles, and Safe ConfigurationStart lab
One stack, two environments, optional extras that cost nothing when unused — and a database password that stops living in the file.
Intermediate · 40 min
- 16Scale the API Behind the GatewayStart lab
Three replicas behind Nginx. One problem announces itself with an error; the other is silent and is the one that matters.
Intermediate · 40 min
- 17Practical Exam B — Restore a Broken StackStart lab
You inherit a deployment that does not work. Several things in the Compose file are wrong, some loudly and some silently. Existing data must survive the repair.
Advanced · 90 min
- 18Prove Graceful ShutdownStart lab
Every deploy drops requests because SIGTERM never reaches the application. Find it in the exit code, fix PID 1, and prove the stop is clean.
Intermediate · 35 min
- 19Health and Resource LimitsStart lab
Give a service a real healthcheck, enforce CPU and memory limits, and run it without root.
Advanced · 25 min
- 20Respond to a Container IncidentStart lab
Slow, restarting, and a disk filling up. Work out which of the three is the cause, restore service, and keep the evidence.
Advanced · 40 min
- 21Harden the RuntimeStart lab
A service running as root with every default capability and a writable filesystem. Apply the four controls and keep it serving.
Advanced · 35 min
- 22Scan, Inventory, and Prove an ImageStart lab
A credential reached a published image. Find it with a scanner, ship a clean rebuild that never contained it, and leave behind an SBOM and a provenance record that name the exact digest.
Advanced · 60 min
- 23The Secret in the LayerStart lab
A credential was copied into an image and deleted in the next instruction. Find it in the layer that still has it, rebuild without it, and harden what runs.
Advanced · 40 min
- 24Publish a Release by DigestStart lab
Push one build under several tags to a private registry, prove they all name the same bytes, then delete every local copy and pull it back by digest.
Intermediate · 45 min
- 25Build the Release PipelineStart lab
Wire build, test, scan and publish into one script that fails fast, refuses to ship a broken revision, and tags every release immutably.
Advanced · 75 min
- 26Promote and Roll Back by DigestStart lab
Promote a tested release without rebuilding, deploy one that passes its health check and answers wrongly, and get back in two minutes.
Advanced · 40 min
- 27Practical Exam C — The Release LifecycleStart lab
Source to a hardened, scanned, signed, published release — then deploy it, find it faulty, and recover by rolling back to a digest you can prove was verified.
Advanced · 120 min
- 28Rescue and Harden ProductionStart lab
A production-like stack is down. Diagnose it, restore service, then harden the image and runtime and prove it survives a database restart.
Advanced · 90 min
Why practice Docker hands-on?
- Docker is not theory; the difference between understanding it and operating it shows the moment a container dies.
- The labs take you from a first container to a full pipeline that publishes a release by digest.
- Several labs are deliberate failures: a fragile Dockerfile, a volume without permissions, a broken service path. Those are the ones you meet at work.
Frequently asked questions
Do I need Linux before the Docker labs?
Terminal basics are enough: moving between directories and running commands. If you want a stronger base, start with the Linux labs and come back.
Do the labs cover Docker Compose?
Yes. There are labs for composing a full service stack, for overrides and profiles, and for scaling an API behind a gateway.
Are there practical exams?
Yes, three practical exams close the course: build a production image, restore a broken stack, and run a complete release lifecycle.