I setup an Ubuntu 13.04 box from www.vagrantbox.es. Post that I made changes to the box - installed ruby, rails, git, mysql, ngnix, etc. How do I share the modified box with someone else?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
After making your changes, use vagrant package
in the directory with the Vagrantfile. It will shut the machine down and start saving it to a file.
You'll end up with a boxfile in that directory that you can share.
回答2:
As already answered, vagrant package
creates a new base box out of an existing VM.
Anyway "the Vagrant way" is to use and share a Vagrantfile with provisioners. This way the installation of the software is repeatable. The downside is that initial vagrant up
takes longer while it installs all the software, but on the other hand the shared base box is smaller. Depends on your use case what is the best.
If you choose to share a pre-installed image you can still benefit from automated provisioning using e.g. Packer to build the box.