Run Docker with 2 cores vs Dual Core Machine

Hi there,

This is my first post.

I need to performance test an application on a dual-core and quad-core machine. If I run a docker container with 2 cpus and 4 cpus respectively, would it be equivalent to testing the application on dual core and quad core machine? I would of course be using the same OS and SWAP space as the original machines.

Thank you in advance and I look forward to contributing to the community

Regards
Rupjit