Which configuration option is used to limit CPU usage for a Docker container?

Prepare for the Docker Certified Associate test with our comprehensive quizzes that include key questions and detailed explanations. Ace your certification!

The configuration option used to limit CPU usage for a Docker container is indeed the option that specifies the number of CPUs allocated to the container. By using the --cpus flag, you can define how much of the available CPU resources a container can use. For example, setting --cpus=0.5 allows the container to use half of a CPU core, while --cpus=2 allows it to use two full CPU cores. This option effectively helps manage performance and resource allocation, ensuring that no single container can monopolize CPU resources, which is crucial in multi-container environments.

The other options listed do not represent valid configuration options for limiting CPU resources. The --cpu-limit and --cpu-usage options do not exist in Docker's command-line interface, and --cpus-limit is not a recognized flag. Therefore, understanding the correct usage of --cpus is essential for Docker administrators who need to manage resource allocation efficiently.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy