[英]How can I access the project directories that are created in the Docker toolbox Linux containers on my Windows OS?
I have just installed Docker ToolBox on Windows 10 OS and created a Linux Python container. 我刚刚在Windows 10 OS上安装了Docker ToolBox,并创建了一个Linux Python容器。 I have cloned a project from GitHub in that container.
我已经从GitHub的容器中克隆了一个项目。 How can I access the project directories that are created in the Linux containers on my Windows OS?
如何访问在Windows OS的Linux容器中创建的项目目录? Are they saved in any drive or directory?
它们保存在任何驱动器或目录中吗?
I have obtained the docker image container using the command 我已经使用以下命令获得了Docker图像容器
docker pull floydhub/dl-docker:cpu
and running it using the command 并使用命令运行它
docker run -it -p 8888:8888 -p 6006:6006 -v /sharedfolder:/root/sharedfolder floydhub/dl-docker:cpu bash
Also I am running my project using docker quick start terminal, is there any other way (GUI based) to manage and run my projects? 另外我正在使用docker quick start terminal运行项目,是否有其他方法(基于GUI)来管理和运行我的项目?
More details about how your Linux Python container was launched, IE the build file/ run command, would be helpful. 有关如何启动Linux Python容器的更多详细信息(即build file / run命令)将很有帮助。 But that being said, you can copy files out of a container using docker cp as described here: https://docs.docker.com/engine/reference/commandline/cp/
话虽如此,您可以按照以下说明使用docker cp从容器中复制文件: https : //docs.docker.com/engine/reference/commandline/cp/
Also, if you use volumes you can view the cloned repo right on your Windows machine directly, but those volumes must be setup during the build process and cannot be added to a running container. 另外,如果使用卷,则可以直接在Windows计算机上直接查看克隆的存储库,但是这些卷必须在构建过程中设置,并且不能添加到正在运行的容器中。 More details on volumes and how data persistence works in docker: https://docs.docker.com/engine/admin/volumes/volumes/
有关卷以及Docker中数据持久性如何工作的更多详细信息: https : //docs.docker.com/engine/admin/volumes/volumes/
To answer your question about a GUI docker tool, I've used Kitematic ( https://kitematic.com/ ) but personally found the CLI faster and easier to use. 为了回答有关GUI docker工具的问题,我使用了Kitematic( https://kitematic.com/ ),但我个人发现CLI更快,更易于使用。
Edit According to edits you do in fact have volumes that will persist data to your local Windows machine. 编辑实际上,根据编辑,您确实具有将数据持久保存到本地Windows机器的卷。 But I believe you need to use a separate -v flag for each: (docker documentation is unclear about this as they now suggest using --mount, but according to this SO post: Mounting multiple volumes on a docker container? suggests the multiple flags):
但是我相信您需要为每个使用单独的-v标志:(docker文档对此尚不明确,因为他们现在建议使用--mount,但根据此SO帖子: 在docker容器上装载多个卷?建议使用多个标志):
docker -v /sharedfolder:/root/sharedfolder \
-v floydhub/dl-docker:cpu
A side note: it is sometimes confusing to not use absolute paths when mounting volumes as you've done in floydhub/dl-docker:cpu. 附带说明:像在floydhub / dl-docker:cpu中所做的那样,在装入卷时不使用绝对路径有时会造成混淆。 Its not always clear where this data might live.
目前尚不清楚这些数据可能存放在哪里。
Any data that is stored in the docker container at /root/sharedfolder should be available in Windows at /sharedfolder Windows中/ sharedfolder的docker容器中/ root / sharedfolder中存储的所有数据都应可用
Edit 2 To match your original docker run command: 编辑2要匹配您原来的docker run命令:
docker run -it -p 8888:8888 -p 6006:6006 -v /sharedfolder:/root/sharedfolder -v floydhub/dl-docker:cpu bash
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.