← 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?
- A.Maven needs it in that order
- B.So Docker can reuse the cached dependency layer when only code changes
- C.To make the image run as root
- 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 →