Bird
0
0

How does squashing layers affect Docker image caching during iterative builds?

hard📝 Application Q9 of 15
Docker - Image Optimization
How does squashing layers affect Docker image caching during iterative builds?
AIt has no effect on caching
BIt improves caching by creating more layers
CIt reduces caching efficiency by merging layers
DIt automatically invalidates all caches
Step-by-Step Solution
Solution:
  1. Step 1: Understand caching with layers

    Docker caches each layer separately to speed up builds.
  2. Step 2: Effect of squashing on caching

    Squashing merges layers, so cache granularity is lost, reducing efficiency.
  3. Final Answer:

    It reduces caching efficiency by merging layers -> Option C
  4. Quick Check:

    Squash merges layers = less caching efficiency [OK]
Quick Trick: Squashing merges layers but reduces cache hits [OK]
Common Mistakes:
  • Thinking squashing improves caching
  • Believing squashing has no effect on cache
  • Assuming squashing invalidates all caches

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes