A harbor-ferry ticketing team rebuilds the same Node image after every one-line route change and waits while package installs run again. Which Dockerfile change keeps the expensive OS and package layers cached across those frequent app edits?
Select an answer to reveal the explanation.
Short Explanation
Picture the Dockerfile as a stack of pancakes: the bottom ones should be the ingredients that barely change. Keep apt-get and friends above the app COPY, and a one-line route tweak only rebuilds the thin top layers instead of cooking the whole stack again.
Full Explanation
Docker caches image layers by instruction order. Instructions that change rarely—base image, package installs—should appear before COPY of application source that changes on every commit. Putting the app copy above package steps invalidates the expensive cache on each edit. Ordering for layer reuse is an image-build concern and is unrelated to AKS node-image management.