在我的Vagrantfile中,我可以指定一个框的URL:
config.vm.box_url = "http://example.com/my-box.pkg"
根据最新文档,我应该能够创建一个JSON文件,其中包含不同版本的Box的URL。该文档还说,我可以在运行时使用此JSON文件的URL vagrant box add
。我希望能够将JSON文件的URL用于config.vm.box_url
。但是,这似乎不起作用。当我尝试它时,它像一个盒子文件一样对待它:
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'my-box' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Adding box 'my-box' (v0) for provider: virtualbox
default: Downloading: http://example.com/my-box.pkg.json
default: Progress: 100% (Rate: 876k/s, Estimated time remaining: 0:00:01)
The box failed to unpackage properly. Please verify that the box
file you're trying to add is not corrupted and try again. The
output from attempting to unpackage (if any):
bsdtar.EXE: Unrecognized archive format: Illegal byte sequence
bsdtar.EXE: Error exit delayed from previous errors.
是否可以告诉Vagrant在我的Vagrantfile中使用盒子元数据JSON文件?我宁愿不必使用Vagrant Cloud。