To keep docker images small you should always run clean commands within the same commit. For example
wont do the expected clean up in terms of image size. Instead do
Furthermore I figured out that it can help to use
--no-install-recommends if the tool I’m installing is just for setting up the image.