13
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

boot2dockerのメモリを増やす

Last updated at Posted at 2014-06-10

boot2dockerの初期値の1Gでは心もとなかったので増やしてみました。
参考:boot2dockerでdockerを試す

$HOME/.boot2docker/profileにVM_MEMを設定してあげる。
(デフォルト:1024)

$ cd $HOME/.boot2docker
$ boot2docker stop
$ boot2docker delete
$ vi profile
$ cat profile
VM_MEM=2048
$ boot2docker init
$ boot2docker start

これでメモリが2048に増える。

docker@boot2docker:~$ free -m
             total         used         free       shared      buffers
Mem:          1000          259          741            0            0
-/+ buffers:                258          742
Swap:          180            0          180
docker@boot2docker:~$ free -m
             total         used         free       shared      buffers
Mem:          2009          265         1743            0            0
-/+ buffers:                264         1744
Swap:          431            0          431

ただ、この方法だと一度deleteしているのイメージやコンテナが消えてしまうので注意。
消えるのが嫌ならstopした後にVirtualBoxから変更した方がいいかもしれない。

$ boot2docker stop
$ VBoxManage modifyvm boot2docker-vm --memory "1024"
$ boot2docker start

これでもメモリが増やすことが出来る。

13
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?