You can just give a chroot. At a company I used to work for, our build system used a chroot with a bunch of rarely-changing binaries/headers that let us build binaries for old distros, and then the directory with the actual code you were working on got bind-mounted into that chroot. The build process didn't depend on anything at all from the host system except for the build tool itself that set up the chroot environment. Everything to actually do the build (compiler, headers, utilities) lived in source control and was put into the build environment from there, so builds were 100% reproducible.