Bird
0
0

What will happen if you run this command?

medium📝 Command Output Q4 of 15
Docker - Resource Management
What will happen if you run this command?
docker run --memory=100m --memory-reservation=150m myapp
AContainer will start with a hard limit of 100MB and soft limit of 150MB.
BDocker will throw an error because reservation cannot be higher than limit.
CContainer will ignore memory-reservation and use 100MB limit only.
DContainer will have a hard limit of 150MB and soft limit of 100MB.
Step-by-Step Solution
Solution:
  1. Step 1: Understand relationship between limits

    Memory reservation must be less than or equal to memory limit.
  2. Step 2: Analyze given values

    Reservation is 150m which is greater than limit 100m, invalid configuration.
  3. Final Answer:

    Docker will throw an error because reservation cannot be higher than limit. -> Option B
  4. Quick Check:

    Reservation ≤ Limit rule = error if violated [OK]
Quick Trick: Reservation must not exceed memory limit [OK]
Common Mistakes:
  • Assuming reservation can be higher than limit
  • Thinking Docker ignores invalid reservation
  • Confusing soft and hard limits

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes