lets even say that i want to create the entire environment from scratch, every storage mount i use has a permission error.
how can i share any directory with the host ?
i tried logging in with user 104, and with the id -u workaround, nothing helps.
We need some details to be able to help you. If you could describe your setup or even share your docker-compose file if that is how you run the container (please be careful to remove any secrets).
Could you run ls -ltra in each of the folders that your map into the grafana container to find who is the owner of the files? (/home/new-grafana/grafana/etc/provisioning and so on)
Hopefully all those files are owned by the same user. If they are you should be able to boot the grafana container as that user to get it working. If they are different you may have to change some permissions.
The user running grafana inside of the container (472 by default) needs access to and subpaths/files:
/var/lib/grafana (read/write)
/etc/grafana (read)
/var/log/grafana (read/write, not used by default)
and i tried using --user root and even id -u, still no permissions.
and i also tried chmod -p 777 /home/new-grafana , and still the container cannot read the folders.
i also tried chown -R 472 /home/new-grafana and changed the owner of all folder tree to 472 (grafana user id inside the container) , and still …
That setup should work, nothing out of the ordinary as long as you use --user root with docker run. My best guess would be that it is related to your Docker installation or your OS, or perhaps a combination thereof. What version of Docker are you running? Any specific security setups related to your centos install?
The . at the end of the permission column in your ls output indicates that there are SELinux ACLs on those folders, that seems like a potential cause for your problems.
I don’t think there’s anyone here that knows SELinux well enough to help you unfortunately. You will have to figure out how to setup the permissions yourself. Alternatively you could probably just use docker volumes for persistant file storage instead of host bindings. I would presume that those wouldnt be affected by SELinux ACLs but I could be wrong.