李明
|
vgrant市场
# -*- mode: ruby -*-# vi: set ft=ruby :Vagrant.require_version ">= 1.6.0"boxes = [ { :name => "docker-redis-cluster", :mem => "8096", :cpu => "2" } ] Vagrant.configure(2) do |config|#这里按照https://app.vagrantup.com/boxes/search 找的镜像进行配置 config.vm.box = "vsvirskiy/centos-7.5-docker" config.vm.box_version = "201808.26.0" boxes.each do |opts| config.vm.define opts[:name] do |config| config.vm.hostname = opts[:name] config.vm.provider "vmware_fusion" do |v| v.vmx["memsize"] = opts[:mem] v.vmx["numvcpus"] = opts[:cpu] end config.vm.provider "virtualbox" do |v| v.customize ["modifyvm", :id, "--memory", opts[:mem]] v.customize ["modifyvm", :id, "--cpus", opts[:cpu]] end config.vm.network :private_network, auto_config: true, ip: "192.168.66.101", bridge:"ens1f0", bootproto: "static", gateway: "192.168.66.1" end end config.vm.provision "shell", privileged: true, path: "./setup.sh"end
PS:这个很类似docker的镜像,需要什么找什么镜像,这个是找对应的虚拟机,我选择的virtualbox,等于别人在特定的系统版本下预装了你需要的软件。对于学习开发很好用。
|
2018-12-10 09:26:53