gem@Ubuntu:~/work/source$ ls
package.box pretty-simple-redismonitor sonar Vagrantfile VirtualBox-4.3.2
gem@Ubuntu:~/work/source$ vagrant package --vagrantfile sonar
/home/gem/work/source/Vagrantfile:5: warning: already initialized constant
VAGRANTFILE_API_VERSION
[default] Clearing any previously set forwarded ports...
[default] Creating temporary directory for export...
[default] Exporting VM...
[default] Compressing package to: /home/gem/work/source/package.box
[default] Packaging additional file: sonar
gem@Ubuntu:~/work/source$ vagrant package --vagrantfile pretty-simple-redismonitor
/home/gem/work/source/Vagrantfile:5: warning: already initialized constant
VAGRANTFILE_API_VERSION
[default] Clearing any previously set forwarded ports...
[default] Creating temporary directory for export...
[default] Exporting VM...
The specified file to save the package as already exists.
Please remove this file or specify a different file name for outputting.
我无法在包中添加其他商品。其实我是流浪汉的新手,请告诉我如何添加并与我的团队成员分享这些包。
答案 0 :(得分:0)
如果要将其他文件添加到打包的框中,则应使用--include
选项。
以下是完整的使用横幅:
Usage: vagrant package [vm-name] [--base name] [--output name.box]
[--include one,two,three] [--vagrantfile file]
--base NAME Name of a VM in virtualbox to package as a base box
--output NAME Name of the file to output
--include x,y,z Additional files to package with the box.
--vagrantfile file Vagrantfile to package with the box.
-h, --help Print this help