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

Question:

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: 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. I also tried putting in a directory called "private," and it gives a different error:

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. Any idea why Mac is not finding the path properly?

Asked By: Samantha Garcia

||

Answers:

I resolved the issue by deleting "/" from in front of "shared_folder":

docker run -ti -v shared_folder:/root/shared_folder bvlc/caffe:cpu bash
Answered By: Samantha Garcia

I had the same issue when I used the terminal. But interestingly when I run via the terminal of Intellij IDE, everything worked well.

I resolved the issue by adding "/" at the end of the shared_folder:
docker run -ti -v ./shared_folder/:/root/shared_folder

Answered By: Mustafa SDET
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.