具有多个同步文件夹的流浪汉 [英] vagrant with multiple sync'd folders
本文介绍了具有多个同步文件夹的流浪汉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
vaprobash
):
# Use NFS for the shared folder
config.vm.synced_folder ".", "/vagrant/Sites",
id: "core",
:nfs => true,
:mount_options => ['nolock,vers=3,udp,noatime']
# Use NFS for the shared folder
config.vm.synced_folder "../Code", "/vagrant/Code",
id: "core",
:nfs => true,
:mount_options => ['nolock,vers=3,udp,noatime']
仅加载第二个映射,忽略另一个--因此我最终得到了一个正确映射的/vagrant/Code
目录,但没有vagrant/Sites
推荐答案
2021年更新:
在2021年,不需要唯一ID或nfs
,只需列出您的同步文件夹:
config.vm.synced_folder ".", "/vagrant/Sites"
config.vm.synced_folder "../Code", "/vagrant/Code"
原始答案:
我只需要为每个挂载设置唯一的ID,然后重新加载流浪箱。
# Use NFS for the shared folder
config.vm.synced_folder ".", "/vagrant/Sites",
id: "sites", # <--- this ID must be unique
:nfs => true,
:mount_options => ['nolock,vers=3,udp,noatime']
# Use NFS for the shared folder
config.vm.synced_folder "../Code", "/vagrant/Code",
id: "code", # <--- different from this one
:nfs => true,
:mount_options => ['nolock,vers=3,udp,noatime']
这篇关于具有多个同步文件夹的流浪汉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文