Skip to content
This repository has been archived by the owner on Sep 7, 2018. It is now read-only.

Allow custom user to be specified #102

Closed
micheljung opened this issue Sep 15, 2017 · 4 comments
Closed

Allow custom user to be specified #102

micheljung opened this issue Sep 15, 2017 · 4 comments

Comments

@micheljung
Copy link

micheljung commented Sep 15, 2017

Currently, this docker image uses a hard coded user and group grafana within the container. The problem with this, when using volumes, is that all files created by grafana:grafana inside the container belong to some "random" user on the host.

In my case, the files created by grafana:grafana belong the the user syslog:crontab on the host.

Now, unless someone knows how to map container users to host users, it would good if the user/group could be specified as environment variables which would be used like so:

chown -R ${GRAFANA_USER}:${GRAFANA_GROUP} /etc/grafana

Alternatively, you could define USER grafana in the Dockerfile. This can then be overridden by the user. I'm no Docker pro, but I read running containers as root is bad practice. Not sure this applies as well if you change users inside the container.

micheljung added a commit to FAForever/faf-stack that referenced this issue Sep 15, 2017
@bergquist
Copy link
Contributor

Sounds like a reasonable solution. A PR would be appreciated.

@micheljung
Copy link
Author

micheljung commented Oct 2, 2017

I'm a bit confused. In run.sh, the owner of directories is changed to grafana but I couldn't find the place where this user is being created. What am I missing?

Update turns out the user is being created by the .deb package, so it's basically baked into the image and can not be changed.

It looks like there's no solution to this. Maybe I need to Isolate containers with a user namespace instead.

micheljung added a commit to micheljung/grafana-docker that referenced this issue Oct 2, 2017
micheljung added a commit to micheljung/grafana-docker that referenced this issue Oct 2, 2017
@wolkenschieber
Copy link

On my host system the grafana-server is run as user ntp. This somehow fails the time synchronization.

@xlson
Copy link
Contributor

xlson commented Mar 29, 2018

This will be resolved when we release Grafana 5.1 with the update image tracked in #146.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants