在Windows上的docker容器中挂载本地目录会无提示失败

时间:2016-06-20 17:22:13

标签: windows docker

我试图将本地Windows目录挂载到docker容器中作为卷,但是在挂载之后我无法在容器中看到任何本地文件。任何人都可以指出我做错了什么吗?

首先我跑:

docker run -v /c/Users/myuser/documents/development:/home image/name`

它执行时没有任何错误消息。然后我跑:

docker run image/name ls /home

并且不显示C:/ Users / myuser / Documents / development中的文件。我是否应该对这应该如何运作做出错误的假设?我的命令中有错误吗?

我还发现,如果我使用-it标志,则卷成功安装,但在退出docker容器时,我看到不再安装卷。这有效:docker run -it -v /c/Users/myuser/documents/development:/home image/name

以下是我的docker.log的最后几行:

time="2016-06-20T19:32:41.843405613Z" level=debug msg="event unhandled: type:\"start-container\" id:\"210bdd5a0a0b13491f388b001bcb7a1add12a65706be7831f82c94d74424025d\" timestamp:1466451161 " 
time="2016-06-20T19:32:41.844850367Z" level=debug msg="Calling POST /v1.23/containers/210bdd5a0a0b13491f388b001bcb7a1add12a65706be7831f82c94d74424025d/resize?h=24&w=111" 
time="2016-06-20T19:32:42Z" level=debug msg="containerd: process exited" id=210bdd5a0a0b13491f388b001bcb7a1add12a65706be7831f82c94d74424025d pid=init status=0 systemPid=1773 
time="2016-06-20T19:32:42.034419978Z" level=debug msg="received containerd event: &types.Event{Type:\"exit\", Id:\"210bdd5a0a0b13491f388b001bcb7a1add12a65706be7831f82c94d74424025d\", Status:0x0, Pid:\"init\", Timestamp:0x576844da}" 
time="2016-06-20T19:32:42.036122814Z" level=debug msg="attach: stdout: end" 
time="2016-06-20T19:32:42.036206299Z" level=debug msg="attach: stdin: end" 
time="2016-06-20T19:32:42.036250871Z" level=debug msg="attach: stderr: end" 
time="2016-06-20T19:32:42.036536700Z" level=debug msg="Closing buffered stdin pipe" 
time="2016-06-20T19:32:42.045908932Z" level=debug msg="Calling GET /v1.23/containers/210bdd5a0a0b13491f388b001bcb7a1add12a65706be7831f82c94d74424025d/json" 
time="2016-06-20T19:32:42.046328482Z" level=debug msg="Revoking external connectivity on endpoint pedantic_visvesvaraya (610b704780467ffa91695276c37bfc30d3e1c5b1a496ac2dda9021bcfdb6890c)" 
time="2016-06-20T19:32:42.185521943Z" level=debug msg="Releasing addresses for endpoint pedantic_visvesvaraya's interface on network bridge" 
time="2016-06-20T19:32:42.185699731Z" level=debug msg="ReleaseAddress(LocalDefault/172.17.0.0/16, 172.17.0.2)" 

0 个答案:

没有答案