New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Variable user/group ID support for Docker #24536
Comments
It isn't exactly true that Dockerfile hardcodes PID/GID, since it takes arguments to control them (i.e., GF_UID and GF_GID). Are you saying you need to change PID/GID after the Docker image has been built? I'm not familiar with that use case. Can you not solve this by configuring PID/GID when building your image? |
I prefer not to build a new image if I don't have to.
|
@xlson Do you know if this is still a problem? |
Still a problem for me. Cannot run grafana on Synology docker due to this. |
Have you tried specifying a different user in docker/docker compose, see "Run Docker as a different user" section in https://grafana.com/docs/grafana/latest/installation/docker/#migrate-to-v51-or-later |
This doesn't work on a synology NAS, since you cant specifiy anything in the docker ui in synology for the docker compose |
Can confirm this is still an issue, realistically one should be able to define a user/group that the container runs as (similar to any linuxserver.io image). My "workaround" so far is to chown the persistent data directory on the host system to 472:472 (which doesn't exist), but this isn't optimal. It seems someone has already managed it in a custom image: https://github.com/homecentr/docker-grafana and https://hub.docker.com/r/woahbase/alpine-grafana/ - may be worthwhile examining. |
This issue has been automatically marked as stale because it has not had activity in the last year. It will be closed in 30 days if no further activity occurs. Please feel free to leave a comment if you believe the issue is still relevant. Thank you for your contributions! |
Stalebot Bump |
What would you like to be added:
The current Dockerfile has PID/GID hardcoded to 472 and therefore cannot be dynamically changed.
Why is this needed:
When deploying with docker-compose there is an extra step, namely the ownership change for the folder where Grafana's data resides.
This would simplify docker-compose setups where .env is used for the rest of the participating components.
This can be resolved easily with s6 overlay in a similar fashion to what the guys at linuxserver.io are doing. There is a further bonus when using s6-setuidgid since it drops root privileges.
I don't mind creating the PR, but I'd like to ask for the dev team's opinion first.
I could not find an open nor closed issue that addresses this, so please forgive me if I'm duplicating a previous question on the topic.
The text was updated successfully, but these errors were encountered: