The path is not shared from the host and is not known to Docker

I am trying to run a docker container, but keep encountering the same error for all paths I specify:

The path /path/to/music is not shared from the host and is not known to Docker.

I have done my research, and added the Users and users paths in the file sharing menu of Docker Desktop. I also have the exact case-sensitive path for the subdirectories added, and keep encountering the same error. I have looked into similiar issues on the forum and Stack Overflow. which did not help.

I am on macOS 14.5 Docker version 27.1.1, build 6312585

/Users is already shared by default. Subdirectories does not have to be shared. Just to make sure we understand eachother, you have /path/to/music on the macOS host and want to mount it into the container at /Users/kamil/Music and not the other way around, right? I have to ask, because it is not common to use /Users inside a container. Linux uses paths like /home/kamil/music. The right side is always the path inside the container, but you seem to actually try to mount /path/to/music from the macOS host which does not exist unless you created it. And if you really want to mount that path, that is the one you have to add to the shared folders, not the one you have inside the container.

Yes

That path exists on the host system. For the container image, as I understood from the documentation I have to tell Navidrome what the external sources of data are so they are not limited to the container. If I remove the container, it would delete that data which is not even a good practice for Docker as far as i understood it.

Use Docker volumes to keep your data and configurations outside the container’s lifecycle. This allows you to manage data and settings independently of container instances.

I’m not quite sure what you are referring to here.

There must be a misunderstanding. You have not added the host path to the shared folders in settings, only the container path. So either the one you think is the host path is actually the container path, or you misunderstood which one you have to add to the shared folders in settings.

I would gladly quote but sou shared it as a screenshot not as text.

-v /path/to/music:/Users/kamil/Music`

That mounts /path/to/music from the macOS host to /Users/kamil/Music inside the container. Docker Desktop “don’t care” about that path in the container, you don’t have to add it to the shared folders in the filesharing settings. That setting is just for sharing the host path with the virtual machine in which the Docker daemon is running so it can access the folder to share it with the container. So if you really have /path/to/music on the macOS host and NOT inside the container, that is the folder you have to set in the File sharing settings. I just don’t know why you would choose such a path on the host and in the container. It is the opposite of what I would expect.

After reading your comment, I updated my command to:

docker run -d \                                                               18:55:46
   --name navidrome \
   --restart=unless-stopped \
   --user $(id -u):$(id -g) \
   -v /Users/kamil/Music:/music \
   -v /Users/kamil/navidrome:/data \
   -p 4533:4533 \
   -e ND_LOGLEVEL=info \
   -e ND_CONFIGFILE=/data/navidrome.toml \
   deluan/navidrome:latest

The container status is for some reason displayed as Restaring (1) and I cannot connect to the container on http://localhost:4533/.

I don’t care what path is used inside the container, I just want to mount local data to the container so it uses it for environment variables.

It doesn’t work, so I might have misunderstood what you meant again? Sorry.

The “docker logs” command is your friend here. If the container is restarting then the process stops in the container and that is what you need to fix. Logs can help.

I’ll look into it. So is that another issue or something related to what we’ve discussed so far? From what I’ve replied, would you say I understood you correctly?

Yes. Since the path did not give you an error message this time, it is probably configured correctly, but it doesn’t mean the contents are correct or have the right permission and it could be a completely independent issue. Or just a wrong parameter, missing config, anything.

Hey, I know this is a year old post, but I am facing some issues on my side as well.
My Mac version is 26.1
Docker engine version is v28.4.0
Docker client version is 4.47.0 (206054)

My docker-compose.yml is

version: '3.8'

services:
  zurg:
    image: ghcr.io/debridmediamanager/zurg-testing:latest    
    container_name: zurg
    restart: unless-stopped
    ports:
      - 9999:9999
    volumes:
      - ./plex_update.sh:/app/plex_update.sh
      - ./config.yml:/app/config.yml
      - zurgdata:/app/data

  rclone:
    image: rclone/rclone:latest
    container_name: rclone
    restart: unless-stopped
    environment:
      TZ: Asia/Kolkata
      PUID: 1000
      PGID: 1000
    volumes:
      - ./rd:/data:rshared # CHANGE /mnt/zurg WITH YOUR PREFERRED MOUNT PATH
      - ./rclone.conf:/config/rclone/rclone.conf
    cap_add:
      - SYS_ADMIN
    security_opt:
      - apparmor:unconfined
    devices:
      - /dev/fuse:/dev/fuse:rwm
    depends_on:
      - zurg
    command: "mount zurg: /data --allow-other --allow-non-empty --dir-cache-time 10s --vfs-cache-mode full"

volumes:
  zurgdata:

Zurg container is running fine but when I run rclone container (it doesn’t run and throws this command as well) it shows:

path /host_mnt/Users/uranus/zurg/rd is mounted on /host_mnt/Users but it is not a shared mount

And when I remove :rshared from ./rd:/data:rshared and run the container, the above error is not shown and the container runs. But the rd doesn’t mount.

If I use the following command in terminal then the rd mounts

./rclone mount zurghttp: rd/ --config ./rclone.conf

What should I do?
I have tried using full path name in ./rd:/data:rshared but still it doesn’t work.

This is the rclone logs. This error shows up only when I stop the container (without :rshared) and doesn’t show anything else.

These are the virtual file shares given to the docker

Sorry but new account only allows 1 embed per post.

I found this for you

https://docs.docker.com/engine/storage/bind-mounts/#configure-bind-propagation

Mount propagation doesn’t work with Docker Desktop.

So unfortunately it will not work with Docker Desktop.

So what are my options?

Depends on your goal. If you want to use mount propagation like rshared, you need a Linux machine and run Docker CE on it. It could be a virtual machine on Mac, but you will need to work inside that virtual machine. Or you could use VSCode or JetBrains ide on your Mac and use remote SSH connection from the IDE so you can work inside the VM while your GUI is on Mac.

I just want the mount to work. I don’t know all these technical stuff :smiling_face_with_tear:
Currently using plist to rclone like this

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
 "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>com.rclone.zurgmount</string>
  <key>ProgramArguments</key>
  <array>
    <string>/Users/uranus/zurg/rclone</string>
    <string>mount</string>
    <string>zurg:</string>
    <string>/Users/uranus/zurg/rd</string>
    <string>--dir-cache-time</string>
    <string>30s</string>
    <string>--allow-other</string>
    <string>--allow-non-empty</string>
    <string>--vfs-cache-mode</string>
    <string>full</string>
    <string>--vfs-cache-max-size</string>
    <string>10G</string>
    <string>--vfs-cache-max-age</string>
    <string>24h</string>
    <string>-v</string>
  </array>
  <key>WorkingDirectory</key>
  <string>/Users/uranus/zurg</string>
  <key>RunAtLoad</key>
  <true/>
  <key>KeepAlive</key>
  <true/>
  <key>StandardOutPath</key>
  <string>/Users/uranus/zurg/rclone.log</string>
  <key>StandardErrorPath</key>
  <string>/Users/uranus/zurg/rclone.err</string>
</dict>
</plist>


Is this the easiest method so far? No workaround with docker?

I don’t know the app you are trying to use, but it doesn’t look like it was designed to run on Docker Desktop. You ask if there is a workaround with Docker. Docker is not Docker Desktop. Docker Desktop runs a virtual machine to run Linux containers in it. And Docker (Docker CE) is running inside that VM too. So not everything can be used with Docker Desktop.

What is this plist file? Is it something on your Mac? How is it related to the project? Are you trying to switch from rclone running on your Mac directly to run rclone in a container?