Closed RaymondMouthaan closed 6 years ago
Hi @RaymondMouthaan
As far as I understand, GF_UID/GF_GID
are not here to customize the container at runtime. You can create image with customized GF_UID/GF_GID
(docker build --build-arg GF_UID=xxx --build-arg GF_GID=yyy ...
) but not at container creation time :
GF_UID/GF_GID
as build argGF_UID/GF_GID
.
So, what you see in your first trial with your compose file is normal behaviour. For the second trial, I didn't check the full consequences of user
, but this is a docker option meant to run the container as the specified user, and so is a different thing.As a I see it :
docker build --build-arg ...
Thanks for you explanation, it clarifies a lot 👍 .
Personally I think it wouldn't be needed to build an image when one wants to use a custom uid. This would mean that every user who wants a custom uid needs to create it's own image. Would it be easier and more maintainable just to read uid from the deploy command as an env and set the grafana uid accordingly and when the env isn't supplied to use the default as defined within the image?
Anyway, I guess this is out of the scope of your project and should be discussed at the official grafana project.
Anyway, I guess this is out of the scope of your project and should be discussed at the official grafana project.
Yes. I want to keep the arm image as close as possible to the official one. So I won't introduce such changes. But, if they do it, I will import that.
Hello @fg2it,
Currently, I have my own docker image available on docker hub, which is based upon yours. It adds some configurations to run the image under a custom uid and gid.
However looking at the official v5.1.0, this custom uid and gid should now be supported and my own docker image wouldn't be needed anymore.
I've tried your lastest version like this:
Within the container:
So from the info above you can see that GF_UID and GF_GID didn't change the uid and gid for user grafana.
I also tried this according to grafana docker install:
Within the container:
So from the info above you can see that user: 1000 didn't change the uid and gid for user grafana, but it did set user 1000 on the grafana.db. The plugins directory however remains assigned to grafana user and group.
I was expecting in one of the above try-outs that all files and dirs within /var/lib/grafana would belong to grafana:grafana, where the uid and gid both could be customly set, so that persistence would be possible with an "external" user.
While writing this, I just realise that it probably is an issue upon the official grafana ...
Can you help me out on this one or do I need to submit an issue at official grafana project?
Thanks in advance. Raymond