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.
/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.
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.
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.