Docker practice: real situations
You solve common problems in containerised apps without guidance, finding the cause and making a lasting fix each time.
Level 201 · 16 lessons · 15 practice labs
Lessons
Run problems
- Port already in use
- An environment variable isn’t applied
- The data vanished with the container
- Permission denied on a volume
- The container won’t stop
- Short task: close the first three on-call tickets
Build problems
- The cache never hits
- An image for the wrong architecture
- Wrong time zone and locale in the container
- Short task: repair the team’s broken Dockerfile
Environment problems
- Two Compose projects overwrite each other
- The container can’t resolve outside names
- The server is full of dangling images and volumes
- The image won’t pull: credentials and certificates
- Short task: close the rest of the night shift’s tickets
Wrap-up
- Capstone: tidy up a messy Docker server you inherited
Practice labs
- The ghost of an old container: Restart the service that fails with ‘name already in use’ and ‘port in use’ by finding and removing the old container holding the name and port.
- An environment variable that doesn’t apply: Show with docker compose config that precedence between the Compose file, env_file and a shell variable sends the wrong value to the app, and make the right value win.
- The container that won’t stop: Stop a container that ignores the stop signal, comes back through its restart policy and holds a hung exec session without corrupting data, and fix the image so it responds to the signal.
- Rescue lost data from an anonymous volume: Find the data thought lost when the container was recreated among the old anonymous volumes, move it into a named volume and prove the app shows the old records.
- Can’t write to the mounted folder: Find the user id mismatch that stops the container writing to Tulip Pharmacy’s upload folder and fix it for good without giving everyone write permission.
- A database that won’t start after a version jump: Bring back the database that jumped a major version through a floating tag and can’t read its data directory by restoring the previous version from backup, pin the tag and show the data is complete.
- Wrong time and broken letters: Fix the time zone and locale in an image that logs the wrong time and garbles non-ASCII letters, and verify with date and a sample output.
- A cache that never hits in CI: Fix the Dockerfile whose cache never hits because of a stamp file that changes every build and an early bulk copy, and compare the times of two builds in a row.
- An image for the wrong architecture: Find the image architecture of a service failing with ‘exec format error’ using inspect, fix the base image digest pinned to the wrong platform, and rebuild and run for the right architecture.
- Two projects overwriting each other: Give separate project names to two Compose projects that remove each other’s containers because their folders share a name, and show both running side by side.
- A container network clashing with the office network: Show from the routing table that the subnet Compose picked clashes with the lab’s office network and makes a server unreachable, define a non-clashing subnet and verify access.
- Half a stack after a reboot: In Silverwater Municipality’s stack that came up only half after a server reboot, find the missing restart policies, the vanished external network and the port clash, fix them and prove it with a reboot.
- An image that won’t pull: unauthorised: Refresh the login on a server that can’t pull from the lab registry because of expired credentials, and show the image pulls.
- A registry password sitting in plain text: Find the registry password sitting encoded in the Docker config file, move it to a credential helper and show the file no longer holds the password and pulls still work.
- Whose volume is this?: On a server you inherited, work out which of dozens of volumes and images belong to stopped but needed containers and which are truly orphaned, clean only the orphans and list your decisions.
About this course
You solve common problems in containerised apps without guidance, finding the cause and making a lasting fix each time.
What you will learn
- Run problems
- Build problems
- Environment problems
- Wrap-up
Prerequisites
Finishing the level 101 courses of the same path, or knowing those topics, is enough.
Lab environment
Lessons run in your own Kali Linux terminal in the browser, connected to a private lab network. Nothing to install.
Frequently asked questions
- Is this course right for my level?
- The course is at level 201; it assumes you know the topics of the lower-level courses.
- Is there anything to install?
- No. Every lesson runs in your own lab environment that opens in the browser.
- How do lessons work?
- Each lesson has 8 to 10 steps and a short quiz. Early steps show the command to type, later steps give less help; if two attempts fail, the solution opens.
- Can I try it for free?
- Yes. The first three lessons of every course are free.