Can't mount /Users/Desktop or similar paths

Hi, I’m on macOS Sierra with a fresh Docker installation (17.03.1-ce-mac12) and I’m having trouble mounting volumes.

I took this simple example from the documentation:

ᕕ(ᐛ)ᕗ ~$ docker run -it -v ~/Desktop/:/Desktop r-base bash
docker: Error response from daemon: Mounts denied:
The path /users/username/Desktop/
is not shared from OS X and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> File Sharing.
See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.
..
¯\_(ツ)_/¯ ~$

The strange thing is, I haven’t changed anything under the File Sharing settings; the /Users directory is there.

I have noticed that with ‘/users’ and ‘/Users’ both point to the same thing, even thought I don’t see a symlink anywhere… I don’t know if this is new with macOS Sierra or not.

Also, my username on the mac, BFay, is different than the home directory, which was somehow setup as /users/username. Could that be an issue?

Tried changing the account name to username to correspond to the home directory, /users/username, tried removing and re-adding /Users in the File Sharing config, these things did not work.

However, I created a totally new user, where the account name and home directory path are the same value. Mounting works for this new user. So, I don’t really know what the original issue was, but at least I have a workaround.

Look at this solution:

Thanks, it looks like that would help for taking a directory from inside of the docker container and mounting it somewhere on the host file system.

What I’m looking for is more of the inverse; I want to take a directory from the host file system (the directory is ~/.aws), and mount it inside the docker container.

This is pretty easy to configure for docker-compose, but it can also be tested more simply with a command like docker run -it -v ~/.aws/:/aws r-base bash

For whatever reason running that command gives me a “Mounts denied” issue for one user on my mac, even though the permissions I have setup should allow it.

However, the new user I created does not have this issue. No idea why.

I was able to successfully mount a path on my Mac laptop inside the container in a kubernetes pod after adding the path on host (that needs to be mounted inside the container) in the list in Preferences --> File Sharing:

17%20AM