The purpose of this docker image is to provide an image for arm64v8 (Raspberry Pi).
Description | Value |
---|---|
OS | arm32v7/arm64v8 |
InfluxDB | 1.8.10 |
Grafana | 9.3.6 |
Telegraf | 1.25.1 |
This is a fork of the repository created by Daniel Gomes. As the last image was over 3 years old and uses 'ancient' versions of InfluxDB, Grafana and Telegraf I decided to take a shot and see if I could get this to more recent versions and still keep it working. And meanwhile learning a bit of creating/maintaining/modifying docker-images.
As to keep it working I might do this in small steps.
As I have only a Raspberry Pi I can only test the image on arm32v7 and arm64v8 after upgrading the Raspberry Pi OS to a 64bits OS.
Starting with Grafana version 8.5.0 I removed arm32v7-support as Grafana wouldn't work in my envioronment and I have unfortunately too less time to figure out why it won't work.
Start the container by running the following command:
docker run -d \
--name influxdb-grafana \
--restart unless-stopped \
-p 3003:3003 \
-p 8086:8086 \
-v /path/for/influxdb_data:/var/lib/influxdb \
-v /path/for/influxdb_log:/var/log/influxdb \
-v /path/for/grafana_data:/var/lib/grafana \
-v /path/for/grafana_log:/var/log/grafana \
-v /path/for/telegraf_log:/var/log/telegraf \
-e "GF_SECURITY_ADMIN_USER=<YOU_USERNAME_HERE>" \
-e "GF_SECURITY_ADMIN_PASSWORD=<YOU_PASSWORD_HERE>" \
-e "TZ=<YOUR_LOCAL_TIMEZONE_HERE>"
pluim003/influxdb-grafana-telegraf:latest
Note: I added a bunch of extra volumes as I like to be able to view stuff directly on my Raspberry Pi. Feel free to modify the docker-run-command to your needs.
To stop the container launch:
docker stop influxdb-grafana
To start the container again launch:
docker start influxdb-grafana
To backup your Docker-volumes you can use the following script:
#!/bin/bash
CONTAINER=influxdb-grafana
RUNNING_CONTAINER=$(docker container ls -q --filter name=${CONTAINER}*)
CONTAINER_VOL1=/var/lib/grafana
CONTAINER_VOL2=/var/lib/influxdb
CONTAINER_VOL3=
BACKUP_DIR=<YOUR_BACKUP_DIRECTORY_HERE>/${CONTAINER}
TODAY=$(date +"%Y%m%d_%H%M")
if [ ! -d "${BACKUP_DIR}" ] ; then
mkdir ${BACKUP_DIR}
fi
docker pause ${RUNNING_CONTAINER}
docker run --rm --volumes-from ${CONTAINER} -v ${BACKUP_DIR}:/backup busybox tar cvpfz /backup/${CONTAINER}cfg_${TODAY}.tgz ${CONTAINER_VOL1} ${CONTAINER_VOL2} ${CONTAINER_VOL3}
docker unpause ${RUNNING_CONTAINER}
# check and delete backupfiles older dan 7 dagen
find ${BACKUP_DIR}/${CONTAINER}cfg* -mtime +7 -exec ls -ltr {} \;
find ${BACKUP_DIR}/${CONTAINER}cfg*.tgz -mtime +7 -exec rm {} \;
find ${BACKUP_DIR}/${CONTAINER}cfg* -mtime +7 -exec ls -ltr {} \;
Host | Container | Service |
---|---|---|
3003 | 3003 | grafana |
8086 | 8086 | influxdb |
docker exec -it influxdb-grafana bash
Username: <User defined in Environment Variable>
Password: <Password defined in Environment Variable>
- Using the wizard click on
Add data source
- Choose a
name
for the source and flag it asDefault
- Choose
InfluxDB
astype
- Fill
URL
withhttp://localhost:8086
- Choose
Server (Default)
asaccess
- Fill the database and the remaining fields and click
Save & Test
.
Basic auth and credentials must be left unflagged. Proxy is not required.
Now you are ready to add your first dashboard and launch some queries on a database.
docker exec -it influxdb-grafana influx