From a portability standpoint, the above could be done with zero OS-specific dependencies, and you could add features depending on the OS. By default you just run the executable with modified environment variables to try to automatically locate things like libraries and other binaries automatically. Then you add chroot, overlayfs, namespaces, control groups, etc as they are available to improve compatibility.