I suspect it's not about the CPU count, but about RAM. On a constrained system, it's possible that the build cannot complete. A few gigabytes of RAM are required, with 8 GiB it should definitely work.
Additionally, if you're on macOS, you need to increase the resource limits in under "Docker Preferences > Resources > Memory".