I’m trying to find a really good blog from years ago but having trouble. This looks good though: https://ericchiang.github.io/post/containers-from-scratch/
Jessica Frazelle's (docker core maintainer) talk on how to build containers in pure bash and C:
There's also this one, which is similar:
And then for a more technical and practical view I would recommend this course:
He goes into cgroups, namespaces, etc. Then does a demo where is manually does what docker does, like untars an image, creates namespaces, creates the networking.
You'll see it is mostly gymnastics with cgroups, btrfs, pivot_root, and some networking commands.
Docker is neat, but it's just using functionality that's already there.