Skip to content

devopshobbies/dockermissions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

DockerMissions ๐Ÿณโš”๏ธ

platform stack docker

Learn Docker by doing โ€” in a real terminal, in your browser.

DockerMissions is a fully local, browser-based training game for Docker. Each mission gives you a live shell, a clear objective, and automatic validation. No cloud. No costs. No copy-pasting from a blog post.

54 progressive challenges across 8 modules โ€” complete beginner to production patterns.

Design and implementation by: Fatemeh


โœจ Features

  • ๐Ÿณ 54 missions across 8 modules โ€” containers, images, networks, volumes, Compose, security, registries, and advanced Docker
  • ๐Ÿ† XP & progression system โ€” earn points, unlock levels, rise through operator tiers
  • ๐Ÿ’ก Progressive hints โ€” reveal only what you need, with XP deduction after the first hint
  • โœ… Instant automated validation โ€” click Check Mission and get a real result in seconds
  • ๐Ÿ” Smart error analysis โ€” detects syntax mistakes and wrong flag ordering with a corrected example
  • ๐Ÿ–ฅ๏ธ In-browser terminal โ€” real bash session connected to a live Docker environment
  • ๐Ÿ… Badges โ€” awarded per module completion and XP milestones
  • ๐Ÿ“Š Leaderboard โ€” track top pilots by XP
  • ๐Ÿ’พ Offline player profiles โ€” no account needed, progress saved locally

๐Ÿš€ Quick Start

git clone <repo-url>
cd dockermissions

# Install dependencies
cd backend && npm install && cd ..
cd frontend && npm install && cd ..

# Generate mission data
node scripts/generate-missions.mjs

# Start both services
./start.sh

Open http://localhost:5173, enter a player name, and pick your first mission.


๐Ÿ“‹ Prerequisites

Tool Version Notes
Node.js 18+ Required for backend and frontend
Docker 24+ Must be running for live validation
npm 9+ Included with Node.js

๐ŸŽฎ How to Play

  1. Open http://localhost:5173
  2. Enter a player name in the right panel to start your offline profile
  3. Select a mission from the campaign map on the left
  4. Read the briefing โ€” understand the objective and starting state
  5. Use the terminal โ€” run real Docker commands to complete the mission
  6. Click Check Mission โ€” automated validation runs against the live Docker state
  7. Earn XP and unlock the next level

๐Ÿ—บ๏ธ Campaign โ€” 8 Modules ยท 54 Levels ยท 4,550 XP

# Module Levels XP Difficulty Key Topics
1 ๐ŸŸข Docker Basics 8 450 Beginner docker run, ports, env vars, exec, logs
2 ๐ŸŸข Images & Dockerfile 8 650 Beginner FROM, RUN, COPY, multi-stage, .dockerignore
3 ๐ŸŸก Networking 7 600 Intermediate Bridge, custom networks, DNS, host, none
4 ๐ŸŸก Volumes & Storage 6 500 Intermediate Named volumes, bind mounts, tmpfs, backups
5 ๐ŸŸก Docker Compose 7 600 Intermediate Multi-service stacks, health checks, scaling
6 ๐Ÿ”ด Security 6 750 Advanced Non-root, read-only rootfs, capabilities, seccomp
7 ๐Ÿ”ด Registry & Distribution 5 450 Advanced Tagging, local registry, push/pull, layer history
8 โšซ Advanced Docker 7 1000 Expert BuildKit, Swarm, contexts, cache mounts, prune

๐Ÿ›ก๏ธ Smart Error Detection

When validation fails, DockerMissions analyses the commands you typed and flags common mistakes:

Command issue detected:
Flags after the image name are passed to the container, not Docker.
  You wrote:  docker run -d nginx --name webserver
  Move --name before the image name.
  Example:    docker run -d --name webserver nginx

Detected patterns include:

  • Docker flags placed after the image name
  • Wrong -p HOST:CONTAINER format
  • Missing -d flag when detached mode is required
  • docker exec without -it when opening a shell
  • docker build without a -t tag

โš™๏ธ Scripts

Script What it does
./start.sh Start backend + frontend in the background
./stop.sh Stop both services
./restart.sh Stop then start

Logs go to tmp/logs/backend.log and tmp/logs/frontend.log.


๐Ÿ“ Project Structure

dockermissions/
โ”œโ”€โ”€ start.sh / stop.sh / restart.sh   โ† service management
โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ missions/data/                 โ† generated mission JSON (54 levels)
โ”‚   โ””โ”€โ”€ src/
โ”‚       โ”œโ”€โ”€ data/                      โ† offline player progress (JSON on disk)
โ”‚       โ”œโ”€โ”€ missions/                  โ† mission loader and parser
โ”‚       โ”œโ”€โ”€ sandbox/                   โ† session and workspace lifecycle
โ”‚       โ”œโ”€โ”€ terminal/                  โ† WebSocket PTY relay (node-pty)
โ”‚       โ”œโ”€โ”€ validation/                โ† mission validation + error analysis
โ”‚       โ””โ”€โ”€ routes/                    โ† Express API routes
โ”œโ”€โ”€ frontend/
โ”‚   โ””โ”€โ”€ src/
โ”‚       โ”œโ”€โ”€ components/                โ† UI components (terminal, briefing, hintsโ€ฆ)
โ”‚       โ”œโ”€โ”€ api/                       โ† typed API clients
โ”‚       โ”œโ”€โ”€ pages/                     โ† MissionPage layout
โ”‚       โ”œโ”€โ”€ store/                     โ† Zustand game state
โ”‚       โ””โ”€โ”€ styles/                    โ† global CSS (dark terminal theme)
โ”œโ”€โ”€ docker/
โ”‚   โ””โ”€โ”€ sandbox/                       โ† sandbox Dockerfile
โ”œโ”€โ”€ modules/                           โ† source-of-truth mission specs (Markdown)
โ”‚   โ”œโ”€โ”€ module_01_basics.md
โ”‚   โ”œโ”€โ”€ module_02_images_dockerfile.md
โ”‚   โ”œโ”€โ”€ module_03_networking.md
โ”‚   โ”œโ”€โ”€ module_04_volumes_storage.md
โ”‚   โ”œโ”€โ”€ module_05_docker_compose.md
โ”‚   โ”œโ”€โ”€ module_06_security.md
โ”‚   โ”œโ”€โ”€ module_07_registry.md
โ”‚   โ””โ”€โ”€ module_08_advanced.md
โ”œโ”€โ”€ scripts/
โ”‚   โ””โ”€โ”€ generate-missions.mjs          โ† parse modules/ โ†’ backend/missions/data/
โ”œโ”€โ”€ GAME_PLAN.md                       โ† full design document
โ””โ”€โ”€ AI_IMPLEMENTATION_PROMPT.md        โ† implementation spec for AI assistants

๐Ÿ”„ Regenerating Mission Data

After editing any file in modules/, regenerate the mission JSON:

node scripts/generate-missions.mjs

Then restart the backend to pick up the changes.


๐Ÿงฉ Tech Stack

Frontend

  • React 18 + TypeScript + Vite
  • xterm.js (terminal emulator with PTY resize support)
  • Zustand (state management)
  • Inter + JetBrains Mono (via Google Fonts)

Backend

  • Node.js + Express + TypeScript (ESM)
  • node-pty (real PTY, not pipe โ€” gives a proper interactive shell)
  • ws (WebSocket server)
  • File-backed JSON store (no database required)

Runtime

  • Host Docker socket for live container/image/network/volume validation
  • Per-session workspace directories with automatic cleanup (30-minute TTL)
  • Command log with syntax analysis for actionable error messages

๐Ÿ“– Contributing

To add or change missions:

  1. Edit the relevant file in modules/
  2. Regenerate: node scripts/generate-missions.mjs
  3. Test the mission flow in the UI

To change validation logic:

To report a bug or suggest a new mission:

  • Open an issue with the mission ID and what you expected vs. what happened

โญ Support the Project

If DockerMissions helped you learn Docker:

  • ๐ŸŒŸ Star this repo โ€” helps others discover it
  • ๐Ÿ› Open an issue โ€” report bugs or suggest new levels
  • ๐Ÿค Contribute โ€” new missions, validation checks, UI improvements

๐Ÿ“„ License

MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors