https://github.com/drpsychick/docker-influxdb
InfluxDB based on alpine, fully configurable through ENV
https://github.com/drpsychick/docker-influxdb
12-factor alpine docker influxdb
Last synced: about 1 month ago
JSON representation
InfluxDB based on alpine, fully configurable through ENV
- Host: GitHub
- URL: https://github.com/drpsychick/docker-influxdb
- Owner: DrPsychick
- License: gpl-3.0
- Created: 2018-01-09T21:37:33.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-10-29T21:39:58.000Z (over 1 year ago)
- Last Synced: 2025-04-15T00:32:35.956Z (about 1 year ago)
- Topics: 12-factor, alpine, docker, influxdb
- Language: Shell
- Homepage:
- Size: 43 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [Docker image: influxdb](https://hub.docker.com/r/drpsychick/influxdb/)
influxdb based on the official influxdb images, multiple architectures (amd64,arm64/v8), cloud ready, fully configurable through environment
[](https://hub.docker.com/r/drpsychick/influxdb/tags)
[](https://app.circleci.com/pipelines/github/DrPsychick/docker-influxdb)
[](https://github.com/drpsychick/docker-influxdb/blob/master/LICENSE)
[](https://hub.docker.com/r/drpsychick/influxdb/)
[](https://hub.docker.com/r/drpsychick/influxdb/)
[](https://github.com/drpsychick/docker-influxdb)
[](https://github.com/drpsychick/docker-influxdb/graphs/contributors)
[](https://github.com/drpsychick/docker-influxdb/issues) [](https://github.com/drpsychick/docker-influxdb/issues?q=is%3Aissue+is%3Aclosed) [](https://github.com/drpsychick/docker-influxdb/pulls) [](https://github.com/drpsychick/docker-influxdb/pulls?q=is%3Apr+is%3Aclosed)
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FTXDN7LCDWUEA&source=url)
[](https://github.com/sponsors/DrPsychick)
## Usage
### UPDATE 2021-07-08 - BC breaking change!
The image is now using non-alpine base images and a small go utility ([toml_update](https://github.com/DrPsychick/toml_update)) to read, modify and write a valid toml configuration file.
* no more multi-line variables
* variable name order is no longer relevant
* -> configuration environment is much simpler and more "readable"
```shell
# before
entrypoint_cmd=/entrypoint.sh
conf_templates="influxdb.conf.tmpl:/etc/influxdb/influxdb.conf"
conf_var_prefix=IFX_
# can be overwritten, to add names or to reorder names
conf_vars_influxconf=${conf_vars_influxconf:-'IFX_GLOBAL IFX_META IFX_DATA IFX_COORDINATOR IFX_RETENTION IFX_SHARD-PRECREATION IFX_MONITOR IFX_SUBSCRIBER IFX_HTTP IFX_GRAPHITE IFX_COLLECTD IFX_OPENTSDB IFX_UDP IFX_CONTINUOUS_QUERIES'}
IFX_GLOBAL=reporting-disabled = false
IFX_COORDINATOR=[coordinator]
IFX_COORDINATOR_BASE=write-timeout = "30s"\nmax-concurrent-queries = 10\nquery-timeout = "600s"\nlog-queries-after = "10s"
# after
CONF_UPDATE=/etc/influxdb/influxdb.conf
CONF_PREFIX=IFX
IFX_GLOBAL1=reporting-disabled=false
IFX_COORDINATOR1=coordinator.write-timeout="30s"
IFX_COORDINATOR2=coordinator.max-concurrent-queries=10
IFX_COORDINATOR3=coordinator.query-timeout="600s"
IFX_COORDINATOR_WHATEVER=coordinator.log-queries-after="10s"
```
Try it in 3 steps
### 1 create your own influxdb.env
```
docker run --rm -it drpsychick/influxdb:latest cat /default.env > influxdb.env
# check default configuration:
docker run --rm -it --env-file influxdb.env --name influxdb-1 drpsychick/influxdb:latest influxd config
```
### 2 configure it
Edit settings in `influxdb.env` to your needs:
* do not use spaces after the first `=` unless in quotes
```
IFX_GLOBAL=reporting-disabled=true
```
### 3 test and run it
Run in a separate teminal
```
docker run --rm -it --env-file influxdb.env --name influxdb-1 drpsychick/influxdb:latest --test
docker run --rm -it --env-file influxdb.env --name influxdb-1 --publish 8086:8086 drpsychick/influxdb:latest
```
Test the connection
```
curl http://localhost:8086/query --data-urlencode "q=SHOW DATABASES"
```
## Configure it to your needs
You can use any `IFX_` variable in your `influxdb.env`. They will be added to the config during container startup.
### Example
```
IFX_VAR1=coordinator.write-timeout="30s"
IFX_ANY_OTHER_NAME=coordinator.max-concurrent-queries=10
```
**Beware**:
Docker only support *simple variables*. No ", no ' and especially no newlines in variables.