将目录从Windows机器安装到位于Docker的Tensor的OracleVMBox [英] Mounting directory from windows machine to OracleVMBox for Tensor on Docker

查看:180
本文介绍了将目录从Windows机器安装到位于Docker的Tensor的OracleVMBox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的Windows机器和名为default的Oracle VM虚拟框之间设置了一个共享文件夹张量。 [我运行Windows 7,正在使用Oracle VM Virtual Box Manager和Docker Toolbox。]





然后,我打开Docker Toolbox Quickstart终端,ssh进入默认VM Box,并可以成功地将张量文件夹安装到其目录中,如下所示:





我在本地计算机上创建了hello_world.txt文件显示在VM中。



我的问题是,当我在默认框中的容器中运行tensorflow映像时,似乎无法弄清楚如何使用此目录(也,我是新来的,所以请纠正我,如果我的术语在这里是错误的)。



我退出了默认框,并返回到我的Docker客户终端。我尝试运行以下变量的命令(源自多个网站):

  docker run -it -p 8888:8888 -p 6006:6006 -v / mnt / tensor:/ tensor --name tf gcr.io/tensorflow/tensorflow 

当我得到



所以源文件夹看起来不像我指定的路径。这个地址在哪里?是在我的默认vm还是在我的守护进程客户端/ linux机器?

解决方案

您在VirtualBox上声明了一个共享文件夹,但您仍然需要将其正确挂载到您的VM中。



在您的ssh会话中:

  sudo touch / mnt / sda1 / var / lib /boot2docker/bootlocal.sh 




添加到该文件:




  mkdir -p / mnt / tensorflow 
mount -t vboxsf -o defaults,uid = `id -u docker`,gid =`id -g docker`张量流/ mnt / tensorflow

然后重新启动docker机器(停止,开始)



A -v / mnt / tensor:/ tensor 工作。



检查您的源文件夹是否存在:那是 OP RebeccaK375 ISSU e


我的问题实际上是没有一个张量文件夹挂载,



I set up a shared folder "tensor" between my Windows machine and the Oracle VM Virtual box called "default". [I run Windows 7, am using Oracle VM Virtual Box Manager, and the Docker Toolbox.]

Then, I open the Docker Toolbox Quickstart terminal, ssh into "default" VM Box, and can successfully mount the tensor folder into it's directory, like so:

I created "hello_world.txt" on my local computer and the file displayed in the VM.

My issue is that I cannot seem to figure out how to have this directory be used when I run the tensorflow image in a container within the default box (also, i am new to this, so please correct me if my terminology here is wrong).

I exit out of the "default" box, and back to my Docker Client terminal. I tried running the following variations of commands (sourced from multiple websites):

docker run -it -p 8888:8888 -p 6006:6006 -v /mnt/tensor:/tensor --name tf gcr.io/tensorflow/tensorflow

This lets me access the Jupyter notebook when i got to http://DEFAULT_IP:8888, but I do not see the "tensor" folder that I expect to see. Instead, the directory is just empty.

However, i assumed in the command above that -v DIRECTORY_VM:DIRECTORY_CONTAINER, so that the first address that I give it is the directory within my default VM, which is to map to a directory inside the container running with the tensor image.

Second trial is that I tried this:

docker run -it -p 8888:8888 -p 6006:6006 -v //c/Users/rebeccak.REBECCAPC/tensor:/tensor --name tf gcr.io/tensorflow/tensorflow

In this case, I provided the path to the "tensor" folder on my local machine instead of the VM Box.

Still no success. Could someone tell me how to do this correctly? Thank you.

Also, when I run "docker inspect CONTAINER_NAME" for one of my attempts, I got this for mounts:

So the "source" folder does not look like the path I specified. Where is this address? Is it on my "default" vm or is it on my daemon client/linux machine?

解决方案

You did declare a shared folder on VirtualBox, but you still need to properly mount it in your VM.

In your ssh session:

sudo touch /mnt/sda1/var/lib/boot2docker/bootlocal.sh

Add to that file:

mkdir -p /mnt/tensorflow
mount -t vboxsf -o defaults,uid=`id -u docker`,gid=`id -g docker` tensorflow /mnt/tensorflow

Then restart your docker-machine (stop, start)

A -v /mnt/tensor:/tensor should now work.

Check of course that your source folder does exist: that was OP RebeccaK375's issue:

My issue was actually that there was not a "tensor" folder to mount,

这篇关于将目录从Windows机器安装到位于Docker的Tensor的OracleVMBox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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