Bird
0
0

You want to optimize your CI pipeline to reuse Docker build cache from a previous successful build stored in a remote registry. Which steps should you include?

hard📝 Workflow Q8 of 15
Docker - in CI/CD
You want to optimize your CI pipeline to reuse Docker build cache from a previous successful build stored in a remote registry. Which steps should you include?
APull the cache image before build, then use --cache-from with that image
BBuild the image first, then push it to the registry
CUse --no-cache option to force cache usage
DDelete local images before build to avoid conflicts
Step-by-Step Solution
Solution:
  1. Step 1: Pull cache image from remote registry

    Pulling the cache image locally makes cached layers available for reuse.
  2. Step 2: Use --cache-from option with the pulled image

    This tells Docker to use the pulled image layers as cache sources during build.
  3. Final Answer:

    Pull the cache image before build, then use --cache-from with that image -> Option A
  4. Quick Check:

    Pull cache + --cache-from = reuse layers [OK]
Quick Trick: Pull cache image first, then build with --cache-from [OK]
Common Mistakes:
  • Using --no-cache disables caching
  • Pushing image before build doesn't help cache reuse
  • Deleting images removes cache

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes