If doing this sort of thing, make sure to accomplish it in a single step (image layer) in the Dockerfile.  Otherwise you won&#x27;t be doing any good as the &quot;removed&quot; files actually persist behind a layer which specifies them as removed.