How to increase docker-machine memory Mac

只愿长相守 提交于 2019-11-27 05:57:36

when you create docker machine, you can nominate the memory size:

docker-machine create -d virtualbox --virtualbox-memory 4096 default

Let me know if this helps.

You can do this via the command line. For example, to change the machine from the default 1cpu/2048MB RAM run:

docker-machine stop
VBoxManage modifyvm default --cpus 2
VBoxManage modifyvm default --memory 4096
docker-machine start
Srikar Appalaraju

For Docker version 1.12.1 (build: 12133) and higher on macOS there is an option to change CPU's and RAM from UI and restart docker. You can find the preferences from toolbar. Attaching images for clarity.

Steps: Preferences -> Advanced -> adjust resources -> Apply & Restart

nathanleclaire

Docker Machine maintainer here. I don't think adjusting the config.json manually will work.

Your two options are to either create the machine with --virtualbox-memory set, or to adjust the VM's memory in the VirtualBox GUI ("Settings > System" for that VM I think). Make sure the machine is powered off and there should be a little slider that works.

EDIT: Another answer shows that you can do the in-place operation from the command line as well using VBoxManage.

I couldn't get the other answers to work. The only thing that worked for me was to remove the default machine and re-create it with more memory.

docker-machine rm default
docker-machine create -d virtualbox --virtualbox-memory=4096 --virtualbox-cpu-count=2 --virtualbox-disk-size=50000 default

This fix was found here: https://www.ibm.com/developerworks/community/blogs/jfp/entry/Using_Docker_Machine_On_Windows?lang=en

Other answers showed how to change the memory using VBoxManage:

docker-machine stop default
VBoxManage modifyvm default --memory 4096
docker-machine start default

To confirm the change from the command line:

VBoxManage showvminfo default | grep Memory

OR

docker-machine ssh default free

fox xhyve (another virtualization under macos) you can modify ~/.docker/machine/default/config.json property Driver/Memory (default to 1024) then restart docker machine to apply changes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!