Skip to content

Commit

Permalink
Merge pull request #20 from rubbish/cpus
Browse files Browse the repository at this point in the history
allowing number of CPUs to be customized via DOCKER_CPUS
  • Loading branch information
fnichol committed Apr 10, 2014
2 parents 11aa284 + 08bcbec commit 75d9340
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 75d9340

Please sign in to comment.