docker工具箱:有没有办法挂载其他文件夹,而不是c:\Users Windows? [英] docker toolbox: Is there a way to mount other folders than from c:\Users Windows?
问题描述
我在Windows 7上使用VirtualBox 5.0.6安装了docker工具箱1.8.3。
I installed docker toolbox 1.8.3 using VirtualBox 5.0.6 on Windows 7.
启动期间创建的默认虚拟机 Docker快速入门终端具有一个定义的共享文件夹,用于 c:\Users
。是否可以将其他共享文件夹永久添加到此虚拟机,例如在主机上安装 d:\
驱动器
The default virtual machine created during startup of Docker Quickstart Terminal has one defined shared folder for c:\Users
. Is it possible to persistently add other shared folders to this virtual machine e.g. mounting a d:\
drive on the host?
推荐答案
或者,Boot2Docker包括内置的VirtualBox Guest Additions,用于使用VirtualBox文件夹共享的明确目的。
Alternatively, Boot2Docker includes the VirtualBox Guest Additions built in for the express purpose of using VirtualBox folder sharing.
存在的以下共享名称中的第一个(如果有的话)将自动挂载在指定的位置:
The first of the following share names that exists (if any) will be automatically mounted at the location specified:
c/Users share at /c/Users
/c/Users share at /c/Users
c:/Users share at /c/Users
如果需要其他路径或共享,可以在运行时通过执行以下操作进行安装: p>
If some other path or share is desired, it can be mounted at run time by doing something like:
$ mount -t vboxsf -o uid=1000,gid=50 your-other-share-name /some/mount/location
您可以在 VirtualBox / Guest添加/共享文件夹
从命令行,您可以使用VBoxManage创建共享文件夹,如下所示:
From the command line, you can create shared folders using VBoxManage, as follows:
VBoxManage sharedfolder add "boot2docker-vm" --name "sharename" --hostpath "C:\test"
这篇关于docker工具箱:有没有办法挂载其他文件夹,而不是c:\Users Windows?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!