-
Notifications
You must be signed in to change notification settings - Fork 378
Bind-mounting read-only grafana.ini causes: chown: changing ownership of '/etc/grafana/grafana.ini': Read-only file system #51
Comments
Bump. Ended up copying grafana.ini into my container image instead of voluming it. Mounting it as RW is not an acceptable option. |
This remains an issue. |
Indeed it does. |
Any update on this? I'm trying to use this with |
Any update on this? |
This is happening because the entrypoint script tries to chmod Line 10 in b96242c
Looking at what actually gets created there, there's only an ldap config file:
Question to devs: Is this ownership necessary? AFAIK config under /etc is normally owned by root. As a workaround, you can mount
|
Working on the assumption that In testing it seems to work fine with a read-only |
Fixed in 291c817 |
I am not so sure about that. Is this really a fix? Consider:
What happens? Startup script does nothing (no chown anymore) but when Grafana itself starts as the container-nonroot-user it cannot access the configuration file because it is chmod so that only root can access it. The problem is not the chown, it is that Grafana does not run as root inside the container, IMO. |
Hi @sandersaares, There are several problems with how we handle file ownership and what user grafana runs as inside the container that, those issues are being tracked in #141. The issue being dealt with in this issue (#51) is the chowing of When it comes to chowing it is something I wish to remove completely, if you volume mount a file system into the container it is your responsibility as a user to make sure that the files and folders within that filesystem has the correct file permissions for Grafana to be able to use them. Currently that is harder to accomplish than neccessary, but not impossible. In the future it should be possible to configure what userid and groupid that Grafana runs as as to make sure that you as a user can easily control file ownership. |
run.sh fails when the ownership of grafana.ini cannot be changed, which means that /etc/grafana/grafana.ini cannot be bind-mounted as read-only.
Specifically, it exits with the error:
chown: changing ownership of '/etc/grafana/grafana.ini': Read-only file system
The text was updated successfully, but these errors were encountered: