Bird
0
0

Which of the following is the correct way to specify the Docker service in a GitLab CI job to enable Docker commands?

easy📝 Syntax Q12 of 15
Docker - in CI/CD
Which of the following is the correct way to specify the Docker service in a GitLab CI job to enable Docker commands?
Aservices: - docker:dind
Bservices: - docker:latest
Cservices: - docker:build
Dservices: - docker:run
Step-by-Step Solution
Solution:
  1. Step 1: Recall the correct service name for Docker-in-Docker

    The official Docker-in-Docker service image is docker:dind, which must be specified exactly to enable Docker commands in GitLab CI.
  2. Step 2: Compare options to find exact match

    Only services: - docker:dind uses the correct service name docker:dind. Other options are invalid or do not exist as official images.
  3. Final Answer:

    services: - docker:dind -> Option A
  4. Quick Check:

    Correct service name = docker:dind [OK]
Quick Trick: Use exact service name 'docker:dind' for Docker commands [OK]
Common Mistakes:
  • Using 'docker:latest' instead of 'docker:dind'
  • Adding extra tags like 'build' or 'run'
  • Omitting the services section

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes