Bird
0
0

Why is it recommended to use the docker:dind service with the --privileged flag in GitLab CI pipelines that build Docker images?

hard📝 Conceptual Q10 of 15
Docker - in CI/CD
Why is it recommended to use the docker:dind service with the --privileged flag in GitLab CI pipelines that build Docker images?
ABecause it allows the job container to run as root user
BBecause it speeds up the build process by using privileged cache
CBecause Docker daemon inside dind needs elevated privileges to run properly
DBecause it enables automatic deployment after build
Step-by-Step Solution
Solution:
  1. Step 1: Understand Docker-in-Docker requirements

    The Docker daemon inside the dind service requires elevated privileges to run containers inside containers.
  2. Step 2: Role of --privileged flag

    The --privileged flag grants the dind container the necessary permissions to operate Docker daemon correctly.
  3. Final Answer:

    Docker daemon inside dind needs elevated privileges to run properly -> Option C
  4. Quick Check:

    dind needs privileged mode for Docker daemon [OK]
Quick Trick: dind requires privileged mode to run Docker daemon [OK]
Common Mistakes:
  • Thinking privileged speeds build
  • Confusing privileged with root user in job
  • Assuming privileged enables deployment

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes