I've been playing around with docker on a mac so I need to install boot2docker to make it work.
I have a pretty powerful machine and a very resource hungry app so I want to up the available memory from the default which is 1GB to something like 8GB.
This is what I've tried
Booting boot2dock with the --memory param
boot2docker --memory=8116 boot
Change the config file
Verbose = true
VBM = "VBoxManage"
SSH = "ssh"
SSHGen = "ssh-keygen"
SSHKey = "/Users/mjsilva/.ssh/id_boot2docker"
VM = "boot2docker-vm"
Dir = "/Users/mjsilva/.boot2docker"
ISO = "/Users/mjsilva/.boot2docker/boot2docker.iso"
VMDK = ""
DiskSize = 20000
Memory = 8116
SSHPort = 2022
DockerPort = 2375
HostIP = "192.168.59.3"
DHCPIP = "192.168.59.99"
NetMask = [255, 255, 255, 0]
LowerIP = "192.168.59.103"
UpperIP = "192.168.59.254"
DHCPEnabled = true
Serial = false
SerialFile = "/Users/mjsilva/.boot2docker/boot2docker-vm.sock"
and then booting boot2docker
boot2docker boot
None of this approaches seem to work. I only end up only having the default memory.
The only way I manage to change was going to virtualbox GUI shutdown boot2docker, change it manually and boot it again.
Am I missing something?
As boot2docker init -m
did not work in my version of boot2docker, I just used VBoxManage command:
VBoxManage modifyvm boot2docker-vm --memory 3500
Also, using this I believe you can avoid destroying your VM, you should just stop
it and then start
again.
It is NOT necessary to delete
your boot2docker vm
as Abel Muiño said.
Its enough what to do what Alex Petrenko proposed.
boot2docker stop
VBoxManage modifyvm boot2docker-vm --memory 3500
boot2docker start
You will need to re-initialize the boot2docker VM with the new memory settings:
$ boot2docker delete
$ boot2docker init -m 5555
... lots of output ...
$ boot2docker info
{ ... "Memory":5555 ...}
You can now boot2docker up
and the image will always use the configured amount of memory.
You can just tweak the settings in the GUI as well.
No need to delete your boot2docker vm.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With