Skip to content

Instantly share code, notes, and snippets.

@scotthaleen
Created December 19, 2016 22:21
Show Gist options
  • Save scotthaleen/f7ba55ca3cedd4a8097f2f139177ddc7 to your computer and use it in GitHub Desktop.
Save scotthaleen/f7ba55ca3cedd4a8097f2f139177ddc7 to your computer and use it in GitHub Desktop.
Adjust Docker Machine Memory & CPU
# Adjust Docker Machine Memory+CPU
# http://stackoverflow.com/questions/32834082/how-to-increase-docker-machine-memory-mac
docker-machine stop
VBoxManage modifyvm default --cpus 2
VBoxManage modifyvm default --memory 4096
docker-machine start
@ssi-victoriano-eco
Copy link

if from windows and VBoxManage is not in your ENV, specify the whole path in "Program Files"

docker-machine stop
/c/Program Files/Oracle/VirtualBox/VBoxManage modifyvm default --cpus 4
/c/Program Files/Oracle/VirtualBox/VBoxManage modifyvm default --memory 4096
docker-machine start

It will not reflect immediately if you print the config docker-machine inspect, but it will be shown when you do the below or modify the config.json of the docker-machine itself

$ docker exec -ti container-instance-name /bin/bash
root@abcd1234:/# cat /proc/cpuinfo

@ScriptAutomate
Copy link

ScriptAutomate commented Jan 21, 2021

If creating a new docker-machine vm, the defaults can also be overridden at creation:

docker-machine create -d virtualbox --virtualbox-cpu-count=2 --virtualbox-memory=4096 default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment