Bird
0
0

Which Dockerfile instruction creates a new layer that can be cached during CI builds?

easy📝 Conceptual Q2 of 15
Docker - in CI/CD
Which Dockerfile instruction creates a new layer that can be cached during CI builds?
ACMD
BRUN
CLABEL
DENV
Step-by-Step Solution
Solution:
  1. Step 1: Review Dockerfile instructions and layers

    Each Dockerfile instruction creates a layer, but RUN executes commands creating filesystem changes.
  2. Step 2: Identify which instruction affects caching

    RUN creates layers with changes that can be cached; ENV and LABEL set metadata, CMD sets runtime command.
  3. Final Answer:

    RUN -> Option B
  4. Quick Check:

    Layer-creating instruction = RUN [OK]
Quick Trick: RUN commands create cacheable layers in Dockerfile [OK]
Common Mistakes:
  • Confusing CMD with layer creation
  • Thinking ENV creates large cache layers
  • Assuming LABEL affects caching

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes