From 08bcbec391acd2ccf0eeb3ab5211b5fdedee1a6c Mon Sep 17 00:00:00 2001 From: Luke Amdor Date: Thu, 20 Feb 2014 08:39:35 -0600 Subject: [PATCH] allowing number of CPUs to be customized via DOCKER_CPUS --- README.md | 1 + Vagrantfile | 3 +++ 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index e31c1cb..b1d9935 100644 --- a/README.md +++ b/README.md @@ -210,6 +210,7 @@ If you wish to change the Docker TCP port or memory settings of the virtual mach * `DOCKER_IP`: `192.168.42.43` * `DOCKER_PORT`: `4243` * `DOCKER_MEMORY`: `512` (in MB) +* `DOCKER_CPUS`: `1` * `DOCKER_ARGS`: `-H unix:// -H tcp://` See [dvm.conf][dvm_conf] for more details. diff --git a/Vagrantfile b/Vagrantfile index 28cfee3..31abf30 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -8,6 +8,7 @@ ip = ENV.fetch("DOCKER_IP", "192.168.42.43") port = ENV.fetch("DOCKER_PORT", "4243") memory = ENV.fetch("DOCKER_MEMORY", "512") +cpus = ENV.fetch("DOCKER_CPUS", "1") args = ENV.fetch("DOCKER_ARGS", "") if args.empty? && port != "4243" @@ -73,12 +74,14 @@ Vagrant.configure("2") do |config| v.customize ["modifyvm", :id, "--natdnsproxy1", "on"] v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] v.customize ["modifyvm", :id, "--memory", Integer(memory)] + v.customize ["modifyvm", :id, "--cpus", Integer(cpus)] end ["vmware_fusion", "vmware_workstation"].each do |vmware| config.vm.provider vmware do |v, override| override.vm.box_url = "https://github.com/mitchellh/boot2docker-vagrant-box/releases/download/v0.5.4-1/boot2docker_vmware.box" v.vmx["memsize"] = Integer(memory) + v.vmx["numvcpus"] = Integer(cpus) end end