That's not very convenient. I want docker to be able to use all my cores when I build an image.
Even if we pretend docker is a VM, building an image can happen on as many cores as you like in this hypothetical, it's the running of it that should be restricted.
Docker is not a VM. It uses the same kernel as the host