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 = "AlbanMontaigu/boot2docker"
config.vm.provider "virtualbox" do |v|
v.memory = 8192
v.cpus = 8
end
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.synced_folder "C:/Users", "/c/Users"
config.vm.network "private_network", ip: "192.168.99.103"
end
create.bat
docker-machine create --driver generic --generic-ip-address=192.168.99.103 --generic-ssh-user=docker --generic-ssh-key=vagrant.pem default
and run:
vagrant up
create