grafana-sync icon indicating copy to clipboard operation
grafana-sync copied to clipboard

Allow to specify the user when running the docker

Open simone-viozzi opened this issue 3 years ago • 1 comments

To pull my dashboards, I use:

docker run --rm \
  --volume "$(pwd)/grafana-dash:/data" \
  --network "monitor-net" \
  ghcr.io/mpostument/grafana-sync:1.4.10 \
  pull-dashboards --apikey="<...>" --directory="/data" --url http://grafana:3000

But this creates a folder owned by root and require to chown it.

What I would like is to have the ability to specify the user as a parameter to the docker run, like:

$ docker run --rm \
  --volume "$(pwd)/grafana-dash:/data" \
  --network "monitor-net" \
  --user 1000:1000 \
  ghcr.io/mpostument/grafana-sync:1.4.10 \
  pull-dashboards --apikey="<...>" --directory="/data" --url http://grafana:3000
2023/02/02 17:33:43 Pull dashboards command failed open /data/docker-containers.json: permission denied

simone-viozzi avatar Feb 02 '23 17:02 simone-viozzi

Thank you for reporting, i will take a look

mpostument avatar Feb 11 '23 09:02 mpostument