Container dockers are isolated by design from the host system, so you wonβt be able to ask Docker how many processor cores I have.
Using / proc / cpuinfo does not seem to work for me, it always tells me 1 processor per container.
Looking at this question on Github describes a journey to figure out a workaround. Ultimately, this method examines the group to determine which kernels are available, and I think this will work for you:
cat /sys/fs/cgroup/cpuset/cpuset.cpus
source share