InfluxDB on ZimaOS

I am trying to install InfluxDB on ZimaOS.

This is the docker compose file:

compose.yaml

services:
influxdb2:
image: influxdb:latest
ports:
- 8086:8086
environment:
DOCKER_INFLUXDB_INIT_MODE: setup
DOCKER_INFLUXDB_INIT_USERNAME_FILE: /run/secrets/influxdb2-admin-username
DOCKER_INFLUXDB_INIT_PASSWORD_FILE: /run/secrets/influxdb2-admin-password
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN_FILE: /run/secrets/influxdb2-admin-token
DOCKER_INFLUXDB_INIT_ORG: docs
DOCKER_INFLUXDB_INIT_BUCKET: home
secrets:
- influxdb2-admin-username
- influxdb2-admin-password
- influxdb2-admin-token
volumes:
- /DATA/AppData/influxdb2/data:/var/lib/influxdb2
- /DATA/AppData/influxdb2/config:/etc/influxdb2
- /DATA/AppData/influxdb2/secrets:/run/secrets/
secrets:
influxdb2-admin-username:
file: ~/.env.influxdb2-admin-username
influxdb2-admin-password:
file: ~/.env.influxdb2-admin-password
influxdb2-admin-token:
file: ~/.env.influxdb2-admin-token

Unfortunately i get an error regarding the secrets:

Does anyone know how to handle these secrets?

This error happens because ZimaOS does not support Docker secrets.
Secrets (/run/secrets/*) only work with Docker Swarm, and ZimaOS runs standalone Docker.

Docker is trying to bind-mount files like ./env/influxdb2-admin-password, but they don’t exist, which causes the error.

Solution:
Remove all secrets: entries and the *_FILE environment variables.
Use plain environment variables instead.

Example:

environment:
  DOCKER_INFLUXDB_INIT_MODE: setup
  DOCKER_INFLUXDB_INIT_USERNAME: admin
  DOCKER_INFLUXDB_INIT_PASSWORD: yourpassword
  DOCKER_INFLUXDB_INIT_ORG: docs
  DOCKER_INFLUXDB_INIT_BUCKET: home
  DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: yourtoken

This is the supported and expected way to run InfluxDB on ZimaOS.

1 Like