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
  1. 01
    Containers and Images

    Run and inspect your first containers, then build a small image and publish its port.

    Beginner · 20 min

  2. 02
    Identify the Container from Host Evidence

    Monitoring gives you one host PID and nothing else. Work back to the container it belongs to without restarting it.

    Intermediate · 25 min

  3. 03
    Lifecycle and Troubleshooting

    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

  4. 04
    Containerize the Status API

    Take a real Node service from source code to a running, published container — writing the Dockerfile yourself.

    Beginner · 35 min

  5. 05
    Repair a Fragile Dockerfile

    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

  6. 06
    Build Context and Multi-Stage Images

    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

  7. 07
    Build Images for Two Architectures

    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

  8. 08
    Practical Exam A — Build a Production Image

    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

  9. 09
    Backup, Destroy, Restore

    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

  10. 10
    Fix a Volume Permission Failure

    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

  11. 11
    Networks and Volumes

    Connect containers by name on a private bridge network, and prove data survives container replacement with a named volume.

    Intermediate · 25 min

  12. 12
    Three-Zone Network Segmentation

    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

  13. 13
    Restore a Failed Service Path

    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

  14. 14
    Compose the Service Stack

    Define the Status API plus PostgreSQL as one Compose stack: private network, named volume, environment config, and health-aware startup.

    Intermediate · 60 min

  15. 15
    Overrides, Profiles, and Safe Configuration

    One stack, two environments, optional extras that cost nothing when unused — and a database password that stops living in the file.

    Intermediate · 40 min

  16. 16
    Scale the API Behind the Gateway

    Three replicas behind Nginx. One problem announces itself with an error; the other is silent and is the one that matters.

    Intermediate · 40 min

  17. 17
    Practical Exam B — Restore a Broken Stack

    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

  18. 18
    Prove Graceful Shutdown

    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

  19. 19
    Health and Resource Limits

    Give a service a real healthcheck, enforce CPU and memory limits, and run it without root.

    Advanced · 25 min

  20. 20
    Respond to a Container Incident

    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

  21. 21
    Harden the Runtime

    A service running as root with every default capability and a writable filesystem. Apply the four controls and keep it serving.

    Advanced · 35 min

  22. 22
    Scan, Inventory, and Prove an Image

    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

  23. 23
    The Secret in the Layer

    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

  24. 24
    Publish a Release by Digest

    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

  25. 25
    Build the Release Pipeline

    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

  26. 26
    Promote and Roll Back by Digest

    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

  27. 27
    Practical Exam C — The Release Lifecycle

    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

  28. 28
    Rescue and Harden Production

    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

View the full course

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.