Gopi Ande
Gopi Ande

Reputation: 81

Why grafana not able to create directories at /var/lib/grafana

Why grafana not able to create directories at /var/lib/grafana when mounted to a path on the linux machine while running in docker container? By default docker run as root user, so grafana should be able to create any directory as root user

Upvotes: 1

Views: 2845

Answers (1)

Jan Garaj
Jan Garaj

Reputation: 28656

I assume that your are using official Grafana Docker images.

By default docker run as root user

You are not right. Official Grafana Docker images use grafana user - you are running more secure rootless Grafana container:

https://github.com/grafana/grafana/blob/ee405ef0693def6e8c227bbe5b99e062fc072212/Dockerfile#L84

So when you want to mount /var/lib/grafana to the Grafana container, then make sure you have correct write permissions for grafana user (default UID 472 in the container) for that folder configured on your host OS. It is mentioned also in the Grafana doc.

Upvotes: 3

Related Questions