Learn Everything

Paths/DevOps Engineer/Docker / Port Conflicts

Scenariointermediatedocker:24Ask AI

Untangle a Port Conflict

Staging needs its own copy of the app, but production already owns host port 8080 — and publishing a second container onto a busy host port fails with 'port is already allocated'. Prove who owns 8080, find a genuinely free port and give staging its own front door.

Validator

⏱ 0:00

IDLE — checks run live as you type commands; submit when done

01Requirements

live checks
  • A container from app:latest is running○
  • Port 8080 stays mapped to the production container○
  • Staging runs on a different host port (8082)○

02Walkthrough

1 of 8 revealed
  1. 01

    Start the production container

    This container already owns host port 8080. -d detaches it, -p 8080:80 forwards host 8080 to the container's port 80 (order is host:container).

    docker run -d -p 8080:80 app:latest
  2. 7 locked · each failed submit reveals one

03Stuck?

0 of 3 revealed

Take a hint without losing the lab — each one points at the thing to look at, not at the answer.

04AI Tutor

guides, never solves

Tell me what you're stuck on — I'll nudge, not solve. Which requirement are you looking at?

04Notebook

saved locally in this browser

learner@lab — docker:24

↑/↓ recalls commands · Ctrl+Enter submits · type help for the command list