Creating a Volume to access files outside container
Hi - not sure this is a bug, but more of an ask for assistance. I'm running MagicMirrorOS perfectly, attempting to use a module (MMM-ShairportMetadata) that reads the 'Now Playing' airplay music metadata written to a file in /tmp directory (/tmp/shairport-sync-metadata is the full path.) I'm guessing the module is failing because it actually cant access the file, since its outside of the container? Research leads me to believe I could create a volume which mounts the /etc folder into the container via the docker-compose.yml with a line like this in the volumes section:
-/tmp:/tmp
if that is true and works, what relative path would I need to use in the module's configuration to see that file? Would it be the same /tmp/shairport-sync-metadata or something else?
Appreciate any advice or guidance.
I don't know this module but it seems to need data which is located on the host.
So if it expects data in /tmp/shairport-sync-metadata you have to map this directory content into the container in the compose.yaml:
...
volumes:
- /tmp/shairport-sync-metadata:/tmp/shairport-sync-metadata
left side is on the host, right side in the container.
Thank you for the prompt response. Can I map the actual file (what you've described above) or do I simply map the folder the file resides in, per my suggestion? (shairport-sync-metadata is a file in the /tmp directory) Knowing you are unfamiliar with the module, I just want to be sure.
Thanks again!
you can map single files too, same syntax as above (the file on the host must exists, otherwise a directory is created)