14
15

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.

pinataを利用してDocker for Macに与えるメモリ・CPU数を増やす

Posted at

Docker for Mac configuration

現在private betaで公開されているDocker for MacではデフォルトでCPU2つとメモリ2GBが割り当てられている.このままだとLLVMとかPCLのmakeが終わらない(2時間とかかる)ので,設定を弄りたい.Docker for MacはGUI上からメモリ量を変更できる.

image.png (66.4 kB)

…と,見せかけて,このスライダーはVersion 1.11.0-beta8 (build: 6072)時点では動作しない.設定はCUIから操作する必要がある(チェックボックスたちは動いてるっぽい).

pinata

pinata - manage the Docker.app configuration databaseなるツールがDocker for Macには存在する.これを利用すればメモリとCPUの設定を弄ることができる.
まだExperimental Featuresらしい.細かいことは公式のドキュメントを参照.

どうでもいいけどpinataって名前がかわいい.

pinata list

pinata listというコマンドで現在のconfigurationを確認できる.メモリやCPU数はhypervisornativeに設定されている(初期値は(memory=2, ncpu=2)).

$ pinata list
🐳  hypervisor = native (memory=2, ncpu=2)
   The Docker.app includes embedded hypervisors that run the virtual machines
   that power the containers. This setting allows you to control which the
   default one used for Linux is.

 ▸  native: a version of the xhyve hypervisor that uses the MacOSX
              Hypervisor.framework to run container VMs. Parameters:
              memory (VM memory in gigabytes), ncpu (vCPUs)

pinata set

pinata setを利用して値を書き換える.

$ pinata set hypervisor native memory=4 ncpu=4

なお,GUI上には設定が反映されないので注意.

References

14
15
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
14
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?