ݺߣ

ݺߣShare a Scribd company logo
ղԳٽѧ
CVagrant
Create and con?gure lightweight, reproducible, and
portable development environments.
C Onnie
p?ʽ?Ƅӣ_lh
VAGRANT ĵλ
Vagrant
Virtualization ProductVirtualBox,VMware
OSLinux,Windows,Mac
Abܛw
? Vagrant?֧ԮϣVirtualBox,VMware,AWS	

? hʹ?VirtualBox	

? VirtualBoxdWַ?
https://www.virtualbox.org/
VAGRANTdb
? Vagrantd?
http://www.vagrantup.com/downloads.html	

? Vagrant Cloud?
https://vagrantcloud.com/
VAGRANT 
? vagrant cloud?
l?boxƽ̨	

? vagrant box?
ӳnvagrantQ֮box	

? vagrant vm?
vagrant?̓MC
մҸ鴡?ʾͼ
ָe
ָ?	

? vagrant box 	

? vagrant vm
1.VAGRANT BOX 
? vagrant box add 	

? vagrant box remove	

? vagrant box list
2.VAGRANTVM 
?cƳVM	

? vagrant init	

? vagrant destroy
2.VAGRANTVM 
ӣPCcd?	

? vagrant up	

? vagrant halt	

? vagrant reload
2.VAGRANTVM 
M?cx_VM	

? vagrant ssh	

? exit
DEMO
? dbVirtualBox Vagrant	

? ?KM?VMYϊA?
mkdir vbox;cd vbox;	

? ?VM?
vagrant init ubuntu/trusty64	

? VM?
vagrant up	

? ?VM?
vagrant ssh
VAGRANTOn
? ?һVM?һOnVagrant?le	

? ͨVMڵ??Ŀe	

? ׃OnᣬָxȡOn?
vagrant reload
VMľW·O
? C4567portָVM80port?
con?g.vm.network :forwarded_port, host: 4567, guest: 80	

? OVMIP?ֻбCܴȡ?
con?g.vm.network :private_network , ip:192.168.50.4"	

? OCęCԴȡ?
con?g.vm.network :public_network
ͬYϊA
? CVM??һYϊA?
VMڵ??Ŀ=VMe^ /vagrant	

? VMe^/vagrantęAO?
Ψx?ҟo׃?
횏vagrant?leO?
ͬYϊA - O
? Oͬ??Ŀ䛣(žͬ?һ?)?
con?g.vm.synced_folder ."?
, "/vagrant"?
, :mount_options => ["dmode=777","fmode=666"]
o UP
? Еr vagrant upʧԴ_GUI?棬
鿴l?ԭ?
vb.gui = true
Ո
? VagrantپW?
http://www.vagrantup.com/	

? Vagrant doc?
https://docs.vagrantup.com/v2/

More Related Content

ղԳٽѧ