与docker容器(使用docker windows客户端)共享Windows文件夹(c / Users /除外) [英] share windows folder (other than c/Users/) with docker container (using docker windows client)

查看:1059
本文介绍了与docker容器(使用docker windows客户端)共享Windows文件夹(c / Users /除外)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用码头服务器客户端,是否有一种方法可以使用docker容器来共享Windows中的文件夹,而无需通过虚拟盒VM共享文件夹。



已经了解到需要从



从Docker客户端中获取以下命令Windows $ / $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $> der run run run run run der der der der der der der der der der der der der :/ development / windev< imagename> < cmdname>

但是当ls on / development / windev发生时,原来是空的。



当我尝试通过以下命令安装c / Users / username文件夹时没有任何问题

  docker run -it -v // c / Users / username / desktop:/ development / windev< image> <命令> 

,而windev文件夹列出了我希望它是

$ b $的内容b

尝试通过Virtualbox GUI共享F / devFolder并提供完全访问权限,但仍未列出该文件夹的内容。



[我没有使用boot2docker但是docker-machine]



无法共享任何其他文件夹比c / Users /文件夹?如果是的话,我需要做的其他事情,以确保我可以看到挂载文件夹的内容?

解决方案

不仅您必须将其安装在您的VirtualBox中,而且(一旦你完成了一个 docker-machine ssh yourMachine ):

  mount -t vboxsf -o uid = 1000,gid = 50你的其他共享名/一些/ mount / location 

我知道你正在使用 docker-machine ,而不是 boot2docker ,而$ code> docker-machine 仍在使用 boot2docker.iso 基于TinyCore的虚拟机映像,因此此命令仍然适用。


Using docker client, is there a way to share a folder in windows with a docker container without having to first share the folder via the Virtual Box VM.

Have understood the need of having a double slash from this and this

Ran the following command from the docker client for windows

docker run -it -v //F/devfolder:/development/windev <imagename> <cmdname>

but when did a ls on /development/windev , it turned out it was empty.

I did not have any problem when I tried mounting the c/Users/username folder via the following command

docker run -it -v //c/Users/username/desktop:/development/windev <image> <command>

and the windev folder listed the contents as I would expect it to be

Tried sharing F/devFolder via Virtualbox GUI and gave full access but still the contents of the folder is not listed.

[I am not using boot2docker but docker-machine]

Is it not possible to share any other folder than the c/Users/ folder? If yes, anything else I need to do to ensure that I can see the contents of the mounted folder?

解决方案

Not only you have to mount it in your VirtualBox, but you also have to instruct, in your boot2docker TinyCore session that you want that folder visible (once you have done a docker-machine ssh yourMachine):

mount -t vboxsf -o uid=1000,gid=50 your-other-share-name /some/mount/location

I know that you are using docker-machine, and not boot2docker, yet docker-machine is still using a boot2docker.iso VM image based on TinyCore, so this command still applies.

这篇关于与docker容器(使用docker windows客户端)共享Windows文件夹(c / Users /除外)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆