简体   繁体   English

Docker 找不到我在 MacOS Big Sur 上添加到文件共享的路径

[英]Docker not finding a path I added to File Sharing on MacOS Big Sur

I am trying to use docker to help create caffe models using this tutorial , and I am getting an error that my path is not configured, however I followed the instructions to configure the file as shown in the error below:我正在尝试使用 docker 来帮助使用本教程创建 caffe 模型,但我收到一条错误消息,指出我的路径未配置,但是我按照说明配置文件,如下面的错误所示:

docker: Error response from daemon: Mounts denied:  The path /shared_folder is not shared from the host and is not known to Docker. You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing.

I got this error running the following command:我在运行以下命令时遇到此错误:

docker run -ti -v /shared_folder:/root/shared_folder bvlc/caffe:cpu bash

I've tried adding it to my File Sharing directory directly, by editing the json file and adding / to the end of the path, but nothing has worked.我已经尝试通过编辑 json 文件并将 / 添加到路径末尾来直接将它添加到我的文件共享目录,但没有任何效果。 I also tried putting in a directory called "private," and it gives a different error:我还尝试放入一个名为“private”的目录,但它给出了不同的错误:

docker: Error response from daemon: error while creating mount source path '/private/shared_folder': mkdir /private/shared_folder: operation not permitted.

I'm not sure where to go next and can't move forward until I am able to run this command.我不确定下一步到 go 的位置,并且在我能够运行此命令之前无法前进。 Any idea why Mac is not finding the path properly?知道为什么 Mac 找不到正确的路径吗?

I resolved the issue by deleting "/" from in front of "shared_folder":我通过从“shared_folder”前面删除“/”解决了这个问题:

docker run -ti -v shared_folder:/root/shared_folder bvlc/caffe:cpu bash

I had the same issue when I used the terminal.我在使用终端时遇到了同样的问题。 But interestingly when I run via the terminal of Intellij IDE , everything worked well.但有趣的是,当我通过Intellij IDE 的终端运行时,一切正常。

I resolved the issue by adding "/" at the end of the shared_folder: docker run -ti -v./shared_folder/:/root/shared_folder我通过在 shared_folder 末尾添加“/”解决了这个问题: docker run -ti -v./shared_folder/:/root/shared_folder

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM