如何更改 vagrant 中的默认框

发布于 2025-01-16 05:53:02 字数 966 浏览 0 评论 0原文

我想在 Mac M1 中使用命令 vagrant up --provider=docker 来运行 vagrant up,provider is docker。

输出是

Bringing machine 'default' up with 'docker' provider...
==> default: Box 'debian/bullseye64' could not be found. Attempting to find and install...
    default: Box Provider: docker
    default: Box Version: >= 0
==> default: Loading metadata for box 'debian/bullseye64'
    default: URL: https://vagrantcloud.com/debian/bullseye64
The box you're attempting to add doesn't support the provider
you requested. Please find an alternate box or use an alternate
provider. Double-check your requested provider to verify you didn't
simply misspell it.

If you're adding a box from HashiCorp's Vagrant Cloud, make sure the box is
released.

Name: debian/bullseye64
Address: https://vagrantcloud.com/debian/bullseye64
Requested provider: [:docker]

Image debian/bullseye64 is not found,所以我想将框更改为 debian/bullseye。我该怎么办?谢谢大家!

I want to run vagrant up with provider is docker with command vagrant up --provider=docker in Mac M1.

The output is

Bringing machine 'default' up with 'docker' provider...
==> default: Box 'debian/bullseye64' could not be found. Attempting to find and install...
    default: Box Provider: docker
    default: Box Version: >= 0
==> default: Loading metadata for box 'debian/bullseye64'
    default: URL: https://vagrantcloud.com/debian/bullseye64
The box you're attempting to add doesn't support the provider
you requested. Please find an alternate box or use an alternate
provider. Double-check your requested provider to verify you didn't
simply misspell it.

If you're adding a box from HashiCorp's Vagrant Cloud, make sure the box is
released.

Name: debian/bullseye64
Address: https://vagrantcloud.com/debian/bullseye64
Requested provider: [:docker]

Image debian/bullseye64 is not found, so I want to change the box to debian/bullseye. How can I do? Thank all!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

牵强ㄟ 2025-01-23 05:53:02

您的问题中有几件事:

  • 如何更改默认框

如果您打开 Vagrantfile,您会看到类似的内容,

Vagrant.configure("2") do |config|
  ...
  config.vm.box = "debian/bullseye64"
  ...
end

这是您需要更改并替换为新框名称的地方。

  • 没有 debian/bullseye 盒子,因此除非您自己在笔记本电脑上创建了这个盒子,否则您将无法使用它

  • 你想使用 docker,所以你需要一个运行的盒子在 docker 提供程序上,您可以在 vagrant cloud 中搜索这样的框,例如 https://app.vagrantup.com/boxes/search?provider=docker

There are couple of things in your question:

  • how to change the default box

If you open your Vagrantfile, you'll see you have something like

Vagrant.configure("2") do |config|
  ...
  config.vm.box = "debian/bullseye64"
  ...
end

That is the place you need to change and replace by your new box name.

  • There's no debian/bullseye box, so unless you have created this one yourself sitting on your laptop, you will not be able to use it

  • You want to use docker so you need a box that runs on docker provider, you can search for such box in vagrant cloud like https://app.vagrantup.com/boxes/search?provider=docker

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文