Docker工具箱:来自守护程序的错误响应:无效模式:/root/docker [英] Docker Toolbox: Error response from daemon: invalid mode: /root/docker

查看:303
本文介绍了Docker工具箱:来自守护程序的错误响应:无效模式:/root/docker的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Docker新手,目前正在复制课程视频.我必须补充说,我只有Windows 10 Home,因此仅限于Docker Toolbox. (在工作中,我有W 10 Pro并使用Docker本身,没有遇到我要报告的问题).

I am a Docker newbie and currently replicating course videos. I have to add that I only have Windows 10 Home and I am hence limited to Docker Toolbox. (At work I have W 10 Pro and use Docker itself and didnt experience the problem I am about to report).

当我在Windows Power Shell中运行以下命令时:

When I run the following in the Windows Power Shell:

PS C:\Program Files\Docker Toolbox> docker run -ti -h python -v ${pwd}:/root/docker -p 9999:9999 ubuntu:latest /bin/bash

我收到以下错误

C:\Program Files\Docker Toolbox\docker.exe: Error response from daemon: invalid mode: /root/docker.
   See 'C:\Program Files\Docker Toolbox\docker.exe run --help'.

该问题不会在命令提示符下发生,因此它似乎与Power Shell有关. 我没有在讨论区找到任何东西.任何输入将不胜感激.

The problem doesnt occur in the command prompt, so it seems to be related to the Power Shell. I did not find anything in discussion boards. Any input would be appreciated.

最佳 马库斯

推荐答案

在使用docker工具箱时遇到了同样的问题.在源路径以及目标路径之前再使用一个"/"将解决此问题.在您的情况下,它将如下所示:

I got the same issue while using docker toolbox. Using one more '/' before your source path as well as before your target path will resolve this problem. In your case it will look like this:

docker run -ti -h python -v /${pwd}://root/docker -p 9999:9999 ubuntu:latest /bin/bash

如果这不起作用,则尝试使用带有额外的'/'的绝对路径,如下所示:

if this doesn't work then try using absolute path with extra '/' like this:

docker run -ti -h python -v //c/path_to_application://root/docker -p 9999:9999 ubuntu:latest /bin/bash

这篇关于Docker工具箱:来自守护程序的错误响应:无效模式:/root/docker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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