influxdata-docker
influxdata-docker copied to clipboard
Clarify example at dockerhub
Now at https://hub.docker.com/_/influxdb (Database Initialization: Manually Initializing the Database):
$ docker run --rm \
-e INFLUXDB_DB=db0 -e INFLUXDB_ADMIN_ENABLED=true \
-e INFLUXDB_ADMIN_USER=admin -e INFLUXDB_ADMIN_PASSWORD=supersecretpassword \
-e INFLUXDB_USER=telegraf -e INFLUXDB_USER_PASSWORD=secretpassword \
-v $PWD:/var/lib/influxdb \
influxdb /init-influxdb.sh
But without INFLUXDB_HTTP_AUTH_ENABLED=true all this credentials is useless, isn't it? I got a little bit confused.
I borrowed a handful of these; which should have been provided as an example to get a local up and running with grafana; which provides all necessary options on it's install docs for docker https://grafana.com/docs/installation/docker/
is it that these exist and are just hard to find on influxdb docs? Each param is sort-of documented (no concrete example(s))
Its just about that one example. I already described my point, cant add nothing more. If you think that its OK, maybe i got it wrong. Where is my mistake?
I just use user and password and it works just fine for me. Like I said, it's not very well documented that I can see.
I also did not need to run the init-influxdb because it's the entrypoint. I do provide a name and port binding
$ mkdir -p data
$ docker run --rm --name=influxdbtest \
-e INFLUXDB_DB=db0 \
-e INFLUXDB_USER=user -e INFLUXDB_USER_PASSWORD=secretpassword \
-v $PWD/data:/var/lib/influxdb \
-p 8086:8086 influxdb
This is what worked for me using docker-compose. Keep in mind it doesn't work well when changing those settings back and forth. Once the database is initialized it will somehow rebel against changes and output weird errors while authenticating. In my case deleting /tmp/influxdb
directory helped.
influxdb:
environment:
INFLUXDB_DB: project_dev
INFLUXDB_ADMIN_USER: admin
INFLUXDB_ADMIN_PASSWORD: secret
INFLUXDB_HTTP_AUTH_ENABLED: "true"
image: influxdb:latest
ports:
- "8086:8086"
- "8087:8082"
volumes:
- /tmp/influxdb:/var/lib/influxdb