如何在第一次运行时运行 Vagrant 配置?

2023-12-27

我有一个非常简单的 Vagrant 文件,如下所示:

  config.vm.box = "precise32"
  config.vm.synced_folder "./src", "/vagrant/src/"
  config.vm.network "forwarded_port", guest: 8080, host: 8080
  config.vm.provision :shell, :path => "install.sh"

当我做vagrant up the install.sh没有被调用,但我必须重新加载--provision。我该如何跑步install.sh在第一个?


从 Vagrant 1.3 开始,配置仅在第一次启动(即创建机器时)自动运行。

如果您需要在后续运行它reload or up,你必须显式地调用它:

vagrant up --provision

也可以看看:GH-1776 https://github.com/mitchellh/vagrant/issues/1776 [commit] https://github.com/mitchellh/vagrant/commit/e2ddab532d575d786365c3870964a60692bdf1d7.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何在第一次运行时运行 Vagrant 配置? 的相关文章

随机推荐