Getting Started

Your First Lab

A complete walkthrough of starting, solving, and validating your first TLD lab.

This walkthrough uses the dkr-fix-stopped-container lab — a beginner Docker lab where a container has stopped unexpectedly and you need to diagnose and restart it correctly.

Pick a lab

bash
# See all available labs by track
$ tld lab list
 
# Filter by track
$ tld lab list --track docker
 
# Output:
# TRACK LAB ID DIFFICULTY STATUS
# docker dkr-fix-stopped-container beginner available
# docker dkr-fix-broken-dockerfile beginner available
# docker dkr-container-networking intermediate available
# ...

Start the lab

bash
$ tld lab start dkr-fix-stopped-container
 
# Pulling lab environment... done
# Starting containers...
#
# Lab: Fix the Stopped Container
# Difficulty: Beginner
# Track: Docker
#
# Something is wrong. A containerized web service has stopped.
# Your job: get it running again and serving traffic on port 8080.
#
# Read the full scenario: cat ~/.tld/labs/current/README.md
# When ready: tld check

Read the scenario

bash
$ cat ~/.tld/labs/current/README.md
Read the whole README
The README contains the scenario, your objective, and any constraints. Skipping it means missing context that makes the fix obvious.

Investigate

bash
# Check what containers exist
$ docker ps -a
# CONTAINER ID IMAGE STATUS NAMES
# a3f9b2c1d4e5 nginx:alpine Exited (1) 2 minutes ago web-service
 
# Check the logs to see why it exited
$ docker logs web-service
# nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
 
# Check what's using port 80
$ lsof -i :80

Fix it

bash
# Kill the process occupying port 80
$ sudo kill $(lsof -t -i:80)
 
# Restart the container
$ docker start web-service
 
# Verify it's running
$ docker ps
# CONTAINER ID IMAGE STATUS NAMES
# a3f9b2c1d4e5 nginx:alpine Up 3 seconds web-service
 
# Confirm it's serving
$ curl http://localhost:8080

Validate

bash
$ tld check
 
# Running validator...
# ✓ Container web-service is running
# ✓ Container has been running for > 30 seconds
# ✓ Port 8080 is accessible
# ✓ HTTP 200 response from http://localhost:8080
#
# All 4 checks passed.
# Lab complete! +150 XP earned.

Cleanup

bash
# Stop and remove the lab environment
$ tld lab stop
 
# Or force-remove everything including volumes
$ tld lab stop --clean
Next steps
Now try a lab without hints. Browse the Beginner Labs page for your next challenge.