There are too many different linux systems, all with their particularities.
Docker provide an unified sub-system that (almost) guarantees everything will compile fine on any host.