Fix Docker Error response from daemon: Mounts denied (macOS)

Today, I am gonna talk about how we can fix this Docker file sharing error.

Recently I got this error saying I need to share the path on Docker to successfully docker-compose up my container.

It was described as;

You can configure shared paths from Docker -> Preferences… -> Resources -> File Sharing.

I followed it and my path was already there. I already added/shared it before on Docker Preferences as described.

Restarting docker-engine didn’t help.

Lets try fixing it.

Just call the configuration file with any editor you like. I am using nano. If it asks root permission, add sudo in the beginning of command.

Manually edit the configuration file for your docker installation located at:

nano ~/Library/Group\ Containers/group.com.docker/settings.json


Find the key “filesharingDirectories”

filesharingDirectories” : [
  “\/Users,
  “\/Volumes,
  “\/private,
  “\/tmp
],

Here was my path added in the array. But not the ones above.
I just added the first item “\/Users”, and saved

Because my path was under /Users also
So final look was something similar to this:

filesharingDirectories” : [
  “\/Users,
/Users/mymacusername/Desktop/myownpath,
],

Wherever your path is under, add the parent of it like I did. Then save the file and exit.

Now restart your Docker Desktop. If you are not using Docker Desktop, then restart Docker Engine. You got it.

Let me know if this solved your problem too.

Leave a Reply

Your email address will not be published. Required fields are marked *