问题描述
如果我更改配置脚本或更糟的是,基础操作系统,有没有办法强制 vagrant 重新配置或重新下载基础框?我试图更改 config.vm.box
和 config.vm.box_url
,但 vagrant up
仍然很高兴地启动到旧框.
If I change the provision scripts or worse yet, the base OS, is there a way to force vagrant to either re-provision or re-download the base box? I tried to change the config.vm.box
and config.vm.box_url
, but vagrant up
still happily booted up to old box.
我知道我可以使用 vagrant destroy
然后使用 vagrant up
或 vagrant provision
在我自己的机器上重新配置,但我正在谈论一种自动强制我的团队重新配置/重新初始化盒子的方法(例如,在他们执行 git pull
然后一个 vagrant up
- 适当地配置或重新初始化.)
I know I could use vagrant destroy
and then vagrant up
or vagrant provision
for just re-provisioning on my own machine, but I'm talking about a way that automatically force my team to re-provision / reinitialize the box (e.g. after they do a git pull
and then a vagrant up
have it either re-provision or reinitialize appropriately.)
推荐答案
vagrant box --help
给你一些选择.
具体来说,你可以 vagrant box remove
移除一个框,并强制重新配置.
vagrant box --help
gives you some options.
Specifically, you can vagrant box remove <name> <provider>
to remove a box, and force a re-provisioning.
例如,移除 Vagrant 示例框:
For example, to remove the Vagrant sample box:
vagrant box remove precise32 virtualbox
这篇关于强制 Vagrant 在下一个 vagrant up 时重新配置或下载一个新的盒子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!