Bird
0
0

What does the --read-only flag do when starting a Docker container?

easy📝 Conceptual Q11 of 15
Docker - Security
What does the --read-only flag do when starting a Docker container?
ARuns the container with root privileges.
BDeletes all files inside the container before starting it.
CMakes the container's filesystem read-only, preventing any changes inside it.
DAllows the container to write to the host filesystem.
Step-by-Step Solution
Solution:
  1. Step 1: Understand the --read-only flag purpose

    The --read-only flag makes the container's filesystem read-only, so no files can be changed or created inside the container.
  2. Step 2: Compare other options

    Running with root privileges, deleting files, or allowing writes to the host filesystem are unrelated or incorrect behaviors for this flag.
  3. Final Answer:

    Makes the container's filesystem read-only, preventing any changes inside it. -> Option C
  4. Quick Check:

    --read-only = read-only filesystem [OK]
Quick Trick: Remember: --read-only locks container files from changes [OK]
Common Mistakes:
  • Thinking it deletes files instead of locking them
  • Confusing with volume mounts
  • Assuming it grants root access

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes