You're also supposed to delete any dependencies you no longer need after compiling. This image might be unnecessarily large.
https://stackoverflow.com/questions/46221063/what-is-build-d...
https://stackoverflow.com/questions/46221063/what-is-build-d...
This is why multi-stage builds are a thing, which the author advocates against doing.
Author just doesn't know better. That's what happen you never build things from source yourself.