Bird
0
0

Which Dockerfile instruction helps reduce security risks by limiting container privileges?

easy📝 Syntax Q3 of 15
Docker - Security
Which Dockerfile instruction helps reduce security risks by limiting container privileges?
AEXPOSE
BRUN
CCOPY
DUSER
Step-by-Step Solution
Solution:
  1. Step 1: Understand Dockerfile instructions

    USER sets the user the container runs as, limiting privileges.
  2. Step 2: Compare other instructions

    RUN executes commands, COPY adds files, EXPOSE opens ports but does not limit privileges.
  3. Final Answer:

    USER -> Option D
  4. Quick Check:

    Instruction limiting privileges = USER [OK]
Quick Trick: Use USER to run containers with limited rights [OK]
Common Mistakes:
  • Confusing RUN with USER
  • Thinking COPY limits privileges
  • Assuming EXPOSE controls security

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes