

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 2
click for more info
Not enough gems
Cost: 6 gems
1: Docker Logs
incomplete
2: Stats
incomplete
3: Top
incomplete
4: Resource Limits
incomplete
This lesson's interactive features are locked, please to keep using them
When you notice a container's using too many resources, if you don't have the time or the ability to "fix" the code, you can limit the resources the container has available. The docker run command has a few options for limiting resources:
--memory: Limit the memory available to the container--cpus: Limit the CPU time available to the containerdocker run -d --cpus="0.25" --name cpu-stress alexeiled/stress-ng --cpu 2 --timeout 10m
Here, --cpus="0.25" is a Docker flag. --cpu 2 comes after the image name, so it's passed to stress-ng.
Being able to monitor container resources is crucial for maintaining healthy container environments, especially in production settings.
Run and submit the CLI tests.