Cage the Resource Hog
Set memory, CPU and PID limits so one container can't kill the node.
A intermediate Docker challenge worth 10 points. Solve it hands-on in a real Docker environment in your browser - no local setup, no fake shells.
The Challenge
Scenario: Last month cruncher ate all the RAM and the kernel OOM-killed the database next to it. The postmortem action item is yours.
Tasks:
- Recreate
cruncher(imagealpine, commandsleep infinity) with: - memory capped at 128m
- CPU capped at 0.5 cores
- at most 64 processes (fork-bomb guard)
Commands to learn: docker run --memory --cpus --pids-limit, docker stats
Run check when done.