Bird
0
0

Which of the following is the correct Docker run command to limit a container to use at most 0.5 CPUs?

easy📝 Configuration Q12 of 15
Docker - Resource Management
Which of the following is the correct Docker run command to limit a container to use at most 0.5 CPUs?
Adocker run --cpus=0.5 myimage
Bdocker run --cpu-limit=0.5 myimage
Cdocker run --cpu-reservation=0.5 myimage
Ddocker run --cpu=0.5 myimage
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct flag for CPU limit

    The correct Docker flag to limit CPU usage is --cpus, which accepts a decimal value.
  2. Step 2: Check other options for correctness

    --cpu-limit and --cpu-reservation are invalid flags; --cpu is not a valid flag either.
  3. Final Answer:

    docker run --cpus=0.5 myimage -> Option A
  4. Quick Check:

    Use --cpus to set CPU limit [OK]
Quick Trick: Use --cpus flag to limit CPU usage in docker run [OK]
Common Mistakes:
  • Using non-existent flags like --cpu-limit
  • Confusing CPU limit with CPU reservation flags
  • Using --cpu instead of --cpus

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes