Challenge 1: Combine Layers With Cleanup — Possible Solution ==================================================================== RUN apt-get update && \ apt-get install -y git && \ rm -rf /var/lib/apt/lists/* WHY THIS WORKS AS AN ANSWER ------------------------------ All three original commands are combined into ONE RUN instruction using && to chain them and \ for line continuation (purely for readability — the instruction is still one logical command to Docker). Because this is now a SINGLE layer, the apt cache created by apt-get update and the packages installed by apt-get install never exist as their own separate, permanent layer in the image's history — the rm -rf cleanup happens within the SAME layer that created the cache, so the final layer's diff only reflects git actually being installed, with the apt cache never having been "shipped" in an earlier layer's diff at all. This is the direct fix for this chapter's closing gotcha: cleanup only actually saves space when it happens in the same layer as the mess it's cleaning up.