It's often both useful and appropriate in Dockerfiles.
That this is normal docker practice just confirms my belief that docker is to be avoided.