Container request: Grafana

I know a TIG stack has been requested before and deemed low priority due to it having an official image from the developers, but I’d like to request a grafana image even if by itself.

The problem with the official grafana image is that managing persistent data is not really straight forward. Permissions are all messed up and either keep the container from starting or keeps data from being accessible from outside the container.

A linuxserver image does not suffer these problems, so it would be sweet to have one.

Thanks!

1 Like

well, it took some time to create complet TIG container but know it is working ok.

here is part of my compose for TIG

  grafana:
    image: grafana/grafana-oss
    container_name: grafana
    user: "PID:GID"
    volumes:
      - /docker_volumes/tig/grafana:/var/lib/grafana
  #    ports:
  #      - 3000:3000
    depends_on:
      - influxdb
    restart: unless-stopped

PID is user who member of docker group and can manage docker.
GID is docker group

I have not problem with permissions. All file in /docker_volumes/tig/grafana are accesible by mentioned user.

Where is the influxdb definition? This compose file says it depends on it, but it’s not included here.

ok, I did forgot to remove those lines, I did think that you are trying to run grafana alone.

here is my complet TIG compose file

---
version: '3'

networks:
  default:
    name: kontainers
    external: true

services:
  influxdb:
    image: influxdb:2.7.1
    container_name: influxdb
    user: "1000:984"
    env_file:
      - env
    volumes:
      - /docker_volumes/tig/influxdb/:/var/lib/influxdb2
#    ports:
#      - "8086:8086"
    restart: unless-stopped
      
  telegraf:
    image: telegraf:1.27.0
    container_name: telegraf
    user: "1000:984"
    env_file:
      - env
    volumes:
      - /docker_volumes/tig/telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
    depends_on:
      - influxdb
    restart: unless-stopped
      
  grafana:
    image: grafana/grafana-oss
    container_name: grafana
    user: "1000:984"
    volumes:
      - /docker_volumes/tig/grafana:/var/lib/grafana
#    ports:
#      - 3000:3000
    depends_on:
      - influxdb
    restart: unless-stopped

all services are contented to “kontainers” network which I am using for all containers, also swag container is there. I did configure swag so I can access influx and grafana over subdomain.

here is env file

# Automated setup will not run if an existing boltdb file is found at the configured path. 
# This behavior allows for the InfluxDB container to reboot post-setup without encountering "DB is already set up" errors.
#
DOCKER_INFLUXDB_INIT_MODE=setup

# Primary InfluxDB admin/superuser credentials
#
DOCKER_INFLUXDB_INIT_USERNAME=xxxxxx
DOCKER_INFLUXDB_INIT_PASSWORD=xxxxxxx
# generated by openssl rand -hex 32
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=xxxxxxxxxx

# Primary InfluxDB organization & bucket definitions
#
DOCKER_INFLUXDB_INIT_ORG=xxxxx
DOCKER_INFLUXDB_INIT_BUCKET=xxxxx

# Primary InfluxDB bucket retention period
# NOTE: Valid units are nanoseconds (ns), microseconds(us), milliseconds (ms)
# seconds (s), minutes (m), hours (h), days (d), and weeks (w).
#
DOCKER_INFLUXDB_INIT_RETENTION=2w

# InfluxDB hostname; same as docker container name
#
DOCKER_INFLUXDB_INIT_HOST=influxdb

steps to start container

#1 create volume directiories:

mkdir -p /docker_volumes/tig/influxdb
mkdir -p /docker_volumes/tig/telegraf
mkdir -p /docker_volumes/tig/grafana

#2.1 create telegraf.conf
docker run --rm telegraf telegraf config > telegraf.conf
#2.2 edit telegraf.conf and choose what you need
#2.3 cp telegraf.conf /docker_volumes/tig/telegraf/

#3 start

1 Like

Thanks!

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.