I installed Grafana as a container using this docker-compose script:
version: '2.1' services: grafana: container_name: grafana image: proxx/grafana-armv7 network_mode: "host" user: "1000" ports: - 3000:3000 volumes: - /save/grafana:/etc/grafana:rw - /save/grafana:/var/lib/grafana:rw #restart: on-failure depends_on: influxdb: condition: service_healthy
It works, but the </save/grafana/grafana.ini> is blank. I don’t think it’s actually using it. If I want to edit grafana.ini when it’s in a container, several posts online suggest the correct method is to edit environmental variables. If I would rather edit Grafana normally via the ini file, is there something I can change on the compose script to make that possible? Other programs (telegraf, influx) expose the configuration file directly in user space. The conf file isn’t lost inside the container.
For example, my telegraf script:
telegraf: container_name: telegraf image: arm32v7/telegraf network_mode: "host" ports: - 1880:1880 volumes: - /save/telegraf:/etc/telegraf/ # Mount for Docker API access - /var/run/docker.sock:/var/run/docker.sock depends_on: influxdb: condition: service_started mosquitto: condition: service_started
By specifying the volume /save/telegraf maps to /etc/telegraf. But maybe that doesn’t work well for Grafana because then it maps everything into the user directory? Is there a good way of doing it?