Hello community,
when using the following docker compose file (being executed with “docker compose -d”)
version: '3.7'
name: test
services:
telegraf:
image: telegraf
container_name: telegraf
privileged: true
user: telegraf:1000
# "1000" is the group id of the docker daemon, run: $(stat -c '%g' /var/run/docker.sock)
# In case of error: sudo chmod 666 /var/run/docker.sock
volumes:
- /opt/telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
- influxdb
#links:
# - influxdb
network_mode: "host"
ports:
- '127.0.0.1:8125:8125/udp'
influxdb:
image: influxdb:2.4.0
container_name: influxdb
env_file: .env
environment:
- INFLUXDB_INIT_MODE:$INFLUXDB_INIT_MODE
- INFLUXDB_INIT_USERNAME:$INFLUXDB_INIT_USERNAME
- INFLUXDB_INIT_PASSWORD:$INFLUXDB_INIT_PASSWORD
- INFLUXDB_INIT_ORG:$INFLUXDB_INIT_ORG
- INFLUXDB_INIT_BUCKET:$INFLUXDB_INIT_BUCKET
- INFLUXDB_INIT_ADMIN_TOKEN:$INFLUXDB_INIT_ADMIN_TOKEN
#- INFLUXD_LOG_LEVEL:$INFLUXD_LOG_LEVEL
- TZ:$TZ
labels:
com.centurylinklabs.watchtower.enable: "true"
network_mode: "host"
ports:
- '127.0.0.1:8086:8086'
volumes:
- influxdb_data:/imports:/imports
- influxdb_data:/influxdb_data:/var/lib/influxdb
- influxdb_data:/influxdb_data2:/var/lib/docker/volumes
- influxdb_data:/etc/influxdb_data:/etc/influxdb2
grafana:
image: grafana/grafana-oss:latest
container_name: grafana
depends_on:
- influxdb
env_file: .env
network_mode: "host"
#links:
# - influxdb
environment:
- GF_SECURITY_ADMIN_USER=$GF_SECURITY_ADMIN_USER
- GF_SECURITY_ADMIN_PASSWORD=$GF_SECURITY_ADMIN_PASSWORD
ports:
- '127.0.0.1:3000:3000'
volumes:
- grafana_data:/var/lib/grafana
- grafana_data:/etc/grafana/provisioning/
- grafana_data:/var/lib/grafana/dashboards/
volumes:
grafana_data:
influxdb_data:
There are always two additional volumes created…
-
/var/lib/docker/volumes/7a2c464a67ca741fac52cd81a1b90b5fed2af52168da7830fad8333a71c4c99f/_data
→ Containers using volume:
→ Container Name: influxdb <-> mounted at: /var/lib/influxdb2 -
/var/lib/docker/volumes/b560e46e2ffa9cec7f73ee570cfc9dee5065a28345eb8d0db90bcc97eda2566a/_data
→ Containers using volume:
→ Container Name: influxdb <-> mounted at: /etc/influxdb2
How can I add these volumes to “influxdb_data”?