Rebuilds of a city’s permit-intake image are slow because application source changes on every commit. How should Dockerfile instructions be ordered to protect the layer cache?
Select an answer to reveal the explanation.
Short Explanation
Put the ingredients that almost never change on the lower shelves of the cake, and the frosting you tweak daily on top. That way you reuse the heavy layers instead of remaking them every time.
Full Explanation
Each Dockerfile instruction typically produces a layer that the builder can reuse when the instruction and its inputs are unchanged. Ordering stable dependency installs before frequently changing application COPY keeps cache hits high and rebuilds short. Busting early layers with volatile source forces everything below to rebuild.