Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker not able to use all of Macbook's CPU cores

I am currently using a Macbook Pro with i7, which has 8 cores. However, I am not able set the CPU cores to more than 1. When I run

docker run --cpus=2 "my-image"

I get the following error:

docker: Error response from daemon: Range of CPUs is from 0.01 to 1.00, as there are only 1 CPUs available.

What am I missing?

like image 386
user1664213 Avatar asked Jun 19 '17 22:06

user1664213


1 Answers

You need to increase the maximum number of CPUs available to containers in the Docker Server. In OS X you can find them in Preferences -> Advanced.

like image 178
Oliver Avatar answered Sep 18 '22 05:09

Oliver