Bird
0
0

Which of the following is the correct Docker run command syntax to set a memory limit of 500MB?

easy📝 Configuration Q12 of 15
Docker - Resource Management
Which of the following is the correct Docker run command syntax to set a memory limit of 500MB?
Adocker run --mem=500MB myimage
Bdocker run --memory=500m myimage
Cdocker run --memory-limit=500m myimage
Ddocker run --mem-limit=500MB myimage
Step-by-Step Solution
Solution:
  1. Step 1: Recall Docker memory limit flag

    The correct flag is --memory followed by the size with unit, e.g., 500m for 500MB.
  2. Step 2: Check syntax correctness

    Options A, B, and C use incorrect flag names or units.
  3. Final Answer:

    docker run --memory=500m myimage -> Option B
  4. Quick Check:

    Use --memory=500m for 500MB limit [OK]
Quick Trick: Use --memory=500m to set 500MB limit correctly [OK]
Common Mistakes:
  • Using wrong flag names like --mem-limit
  • Using uppercase units like MB instead of m
  • Omitting the equal sign

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes