To provide some data from the host system to the container, I thought mount-bind will do the trick.
Specifically I may make a directory
/data which is effectively located at:
Now I have my container-data in:
Then I mount-bind it:
# mount --bind /home/<username>/container-data/containername /var/lib/lxd/storage-pools/<poolname>/containers/<containername>/rootfs/data
It has the desired effect that I can conveniently add any data with my user and it would directly be available inside the container.
- the container is unprivileged - thus not even the root inside the container may write to these files then
- the container uses directory backend (otherwise not possible?)
Now the great question - Is this a good solution?
I am a bit insecure as it probably is a “avoiding to read the docs”-move.
I think it is not a solution how the system is supposed to be used and maybe some people with more in-depth knowledge of the system could know if there are any problems to be expected.
Thank you and best regards,