What is the main reason to set CPU limits on Docker containers?
Think about how multiple containers share the same machine's CPU.
CPU limits stop one container from hogging all CPU power, so other containers and processes keep running smoothly.
What output will this command produce?
docker run --rm -m 100m busybox free -m
The -m flag sets memory limit for the container.
The container sees only the limited memory set by -m 100m, so free -m reports about 100 MB total memory.
A container crashes with an 'Out of Memory' error. Which Docker option likely caused this?
Think about which option limits memory usage.
The --memory option limits container memory. If set too low, the container can run out of memory and crash.
Put these steps in the correct order to run a Docker container with CPU and memory limits.
Think about planning, running, testing, then deploying.
You first decide limits, then run the container with those limits, test performance, and finally deploy to production.
What is the best reason to avoid running containers without resource limits?
Think about what happens if one container uses too much CPU or memory.
Without limits, a container can consume all host resources, causing slowdowns or crashes for other containers and the host itself.