🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Docker: all 10 questions

Quiz: Docker · Question 5 of 10

Why copy pom.xml and download dependencies before copying src?

Why copy pom.xml and download dependencies before copying src?

  1. A.Maven needs it in that order
  2. B.So Docker can reuse the cached dependency layer when only code changes
  3. C.To make the image run as root
  4. D.So tests are skipped
Answer & explanation

Correct answer: So Docker can reuse the cached dependency layer when only code changes

Layer caching makes rebuilds much faster.

Can you get the rest right without peeking?

Take the timed Quiz: Docker quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →