But this cannot easily be redirected to the /data/ persistent directory of an homeassistant addon.
Why not have an option in the addon config.yaml to easily force external docker images to redirect to db to /data/ directory. Would make integrating more addons much easier
something like this:
volume_redirect:
/var/noisedash/db: /data/db
The addon developer would need how to do this, but much easier than current workarounds.
An addon is supposed to work on any Home Assistant system. How can you guarantee your random path exists and contains what you’d expect on all 150k+ os and supervised installs?
Supervisor is not going to provide a way to bind mount random paths as it can’t guarantee that works everywhere. That’s why it only allows addon devs to choose from specific folders that it knows exist on all HA systems.
I think we are talking past each other. I want to point a “random path” that is INSIDE the docker container (not on the homeassistant host) to /data (or /share/, /ssl) on the homeassistant host. If the path is not available inside the docker container, no biggie, the image just will not work right.
Sounds like you just want a link. So then you can move the db into /data and the software can still think it’s writing to /var or wherever. Just do that in your Dockerfile.
Oh right I’m sorry you can’t do that in the Dockerfile since a persistent volume gets mounted in /data. That’s one you have to do in the cont-init setup script like this addon:
Or if you don’t use s6 then in whatever script you run as CMD.
Tbh now that I know what your asking for I don’t think it’s possible for supervisor to do what you want. If supervisor bind mounted some folder in /var to some folder within /data then that part of /data would no longer be persistent. It would totally defeat the point of the task (to make the db survive addon restarts). Linking during setup is really the only way to do what you want to do here.