Docker labs - 30 hands-on challenges
Solve 30 real Docker challenges in an isolated container in your browser. No setup, no fake shells.
- Run Your First Container - beginner · Start nginx in a container and publish it on a port.
- Hotfix Inside a Running Container - beginner · Use docker exec to fix a live container without restarting it.
- Reclaim the Disk - beginner · Prune dead containers and dangling images without touching production.
- Survive the Reboot - beginner · Give a container a restart policy so daemon restarts don't take it down.
- Diagnose the Crash Loop - intermediate · Read the logs of a restarting container and fix its missing config.
- Fix the Broken Build - intermediate · Debug a Dockerfile that fails to build and serves nothing.
- Data That Survives - intermediate · Move container data onto a named volume so redeploys can't destroy it.
- Prove You're Alive - intermediate · Add a HEALTHCHECK so orchestrators know when the app actually answers.
- Cage the Resource Hog - intermediate · Set memory, CPU and PID limits so one container can't kill the node.
- Free the Port - intermediate · A decommissioned container squats on port 8080 and blocks the new release.
- Connect the Microservices - advanced · Fix name resolution between containers with a user-defined network.
- Slim the Image, Save the Secrets - advanced · Use .dockerignore to keep junk and live secrets out of your image.
- Private Registry - advanced · Run a local registry, then tag and push an image to it.
- Declare the Stack - advanced · Replace hand-typed docker run commands with a compose file.
- Harden the Container - advanced · Strip privileges from a dangerously misconfigured production container.
- Inspect Everything - beginner · Pull runtime facts out of a container with docker inspect.
- Copy In, Copy Out - beginner · Move files between a running container and the host with docker cp.
- Promote the Build - beginner · Retag a CI build the way release pipelines do.
- Fix It Live - beginner · Rename a container and change its limits with ZERO downtime.
- Config From a File - intermediate · Load a container's environment from a reviewable env file.
- Drop Root, Keep Working - intermediate · Run a workload as a non-root user with the right workdir and hostname.
- Find the Leaked Token - intermediate · Dig one leaked credential out of hundreds of log lines.
- Segment the Network - intermediate · Move a sensitive container to its own network — live.
- Pin the IP - intermediate · Give a container a fixed address on a custom subnet.
- Version-Stamped Builds - intermediate · Parameterize a build with ARG so CI stamps every image.
- Air-Gap Transfer - intermediate · Move an image to a network-less site with save and load.
- Death by OOM - advanced · Read a container post-mortem: exit codes, OOMKilled, and the fix.
- Tame the Log Flood - advanced · Cap a chatty container's logs before they eat the disk.
- Ship the Tool, Not the Toolchain - advanced · Convert a bloated single-stage build to multi-stage.
- Secrets Off the Env - advanced · Replace an env-var password with a read-only file-based secret.