Run Python script in Vagrant

試著忘記壹切 提交于 2019-12-07 19:27:26

On your Guest OS there will be a folder under / called /vagrant/ this will be all the files and directories under the directory on your host machine that contains the .VagrantFile

If you put your script in that folder they will be shared with the VM.

Additionally if you are using chef as your provisioner you can use a script resource to run external scripts during the provisioning step.

You have two options:

  1. You can go the classic route of using the shell provisioner using vagrant

    config.vm.provision "shell", inline: $script

And in your script run the python script

  1. All files are pushed in /tmp, you can possible use this to run your python script
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!