You almost certainly don't need to setup linux namespaces, cgroups and every little thing else from scratch For each new container you would like to generate. The Software that will it to suit your needs is known as the "container runtime" - the small, even the bottom stage utility of https://bibisoutherncontainers.com/