I have a Grafana Docker container, when I make an interactive shell on this, this user is not a superuser, so I can't do something that needs the sudo
permission:
docker exec -it grafana_service bash
In this container:
$ su
password:
I haven't any password!
Or I can't use from chmod 777
to make full permission on a filesystem and etc.
This is my docker-compose:
version: '3'
services:
grafana_sevice:
image: grafana/grafana:5.1.3
container_name: grafana_service
restart: unless-stopped
ports:
- "3010:3000"
links:
- another_service
I found the solution:
$ docker exec -it -u 0 grafana_service bash
# chmod 777 /var/lib/grafana/grafana.db
(Thanks to @c4f4t0r)
By default the Grafana container will run with uid/gid 472, so you can chown -R 472:472 /your/grafana/dir
on the host, then the container will be able to write to it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With