Assign core cpu to my container

I have 2 physical CPU, and I can assign core of 2 of cpu 1 and core of 2 of cpu 2 to LXC container.
How can I do it in Docker?

By default a container will use all available cpu and ram ressources and share them with the native process on the host. You specificy need to define ressource constraints to NOT share all ressources with a container.

Realy sorry, Could you please explain more…

Uhm, you did understand that I wrote that it already uses all cpus, didn’t you?
Thus said: I have no idea what to explain more about…

I am not sure I understand eitherm, but if you mean you want to restrict how many cpu cores a container can use, you need the CPU parameters:

I have some old examples too: CPU Limit test

It is also available on GitHub in case I change something on the website.

This is the Dockerfile: