gpt4 book ai didi

ubuntu - Vagrant 自定义框 metadata.json 文件

转载 作者:太空宇宙 更新时间:2023-11-03 16:57:02 24 4
gpt4 key购买 nike

我有一个名为 package.box 的自定义框。尝试 vagrant up, vagrant box add 时出现此错误。我创建了一个具有不同配置但没有成功的 metadata.json 文件。我不明白这条消息。我使用 virtualbox 进行配置。

我不理解他们网站上有关 metadata.json 文件的文档。

The "metadata.json" file for the box 'package.box' was not found.
Boxes require this file in order for Vagrant to determine the
provider it was made for. If you made the box, please add a
"metadata.json" file to it. If someone else made the box, please
notify the box creator that the box is corrupt. Documentation for
box file format can be found at the URL below:
https://www.vagrantup.com/docs/boxes/format.html

package.box 位于空目录中。在它旁边我放了这个 metadata.json 文件:

{
"description": "long box description",
"short_description": "short box description",
"name": "company/developer-environment",
"versions": [{
"version": "1",
"status": "active",
"description_html": "<p>Dev Environment</p>",
"description_markdown": "Dev Environment",
"providers": [{
"name": "virtualbox",
"url": "./package.box"
}]
}]
}

我用的是ubuntu 16.04系统,vagrant 1.8.5,virtualbox 5.0.26。

最佳答案

package.box 文件是您 VM 的 zip 文件,metadata.json 文件不能在 package.box 文件旁边,而是在其中。

因此在打包之前将元数据文件存储在 VM 文件旁边,例如

.
|-- box-disk1.vmdk
|-- box.ovf
|-- metadata.json

因此,当您运行 vagrant package 时,它会将元数据文件作为 box 文件的一部分。

关于ubuntu - Vagrant 自定义框 metadata.json 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38598516/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com