Bird
0
0

Which Docker build command option is used to specify a cache source in a CI pipeline?

easy📝 Syntax Q12 of 15
Docker - in CI/CD
Which Docker build command option is used to specify a cache source in a CI pipeline?
A--rm
B--build-arg
C--no-cache
D--cache-from
Step-by-Step Solution
Solution:
  1. Step 1: Identify cache-related options

    Docker build supports options like --cache-from to specify images to use as cache sources.
  2. Step 2: Match option to cache source usage

    --cache-from tells Docker to use layers from the specified image as cache, which is essential in CI for caching.
  3. Final Answer:

    --cache-from -> Option D
  4. Quick Check:

    Cache source option = --cache-from [OK]
Quick Trick: Use --cache-from to specify cache images in CI builds [OK]
Common Mistakes:
  • Using --no-cache disables caching
  • Confusing --build-arg with caching
  • Thinking --rm affects caching

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes