August 19, 20241 yr I am having issues with file permissions on container bind mounts. I have container A that is writing logs out to a folder in `/mnt/user/appdata/<container A>/xyz.log` The container runs as a non-root user The container is setting the permissions to 640 I have a container B that also runs as a different non-root user that I would like to read the logs If I bind mount `/mnt/user/appdata/<container A>/xyz.log` into container B the process cannot read the file What are my options for resolving this? I have looked into: 1) Install fluentd on unraid server to mirror the logs to a folder that is world readable. - I am not familiar with Slackware installation - not sure if this is a good idea or if there are better alternatives to mirroring files as they are written 2) Install fluentd as a container and force it to run as root to get access to all files 3) Attempt to monkey around with containers A and B to get there uid or gid to align to allow the files to be read. I am not aware of any docker volume magic that can override permissions. Hopefully I am missing something really basic and this will be a great learning moment.
August 20, 20241 yr Author Solution I was unaware that there is a standard - at least for linuxserver.io containers to use uid - 99 and gid - 100. Once this became apparent I looked deeper into my second container and found that I could rebuild it from source and modify its gid to 100. I now have read access to all of my logs from the containers I run into a local free instance of Splunk.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.