Codified docker-machine via Vagrant on Windows for those who need fine-grained configurations enabling versioning and automation which is not provided via docker-machine.
Just using docker-machine do not support custom ip, and custom cpu and/or memory is possible but user need to repeatingly type command like:
docker-machine create machine-vbox --virtualbox-cpu-count "8" --virtualbox-memory "8192"
clone this repo, and declare configrations like following:
Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "joelhandwell/dockerhost"
config.vm.provider "virtualbox" do |v|
v.memory = 4096
v.cpus = 4
end
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.synced_folder "C:/Users", "/c/Users"
config.vm.network "private_network", ip: "192.168.2.193"
end
create.bat
docker-machine create --driver generic --generic-ip-address=192.168.2.193 --generic-ssh-user=vagrant --generic-ssh-key=vagrant default
and run:
vagrant up
create