Pull the latest version of influxdb official image :
docker pull influxdbOr pull specific version of influxdb official image :
docker pull influxdb:<version>Create a directory for influxdb data volume and change directory to it:
mkdir ~/influxtest && cd ~/influxtestRun influxdb container:
docker run --name influxtest -d -p 8086:8086 \
-v $PWD:/var/lib/influxdb \
influxdbFor run with custom config file :
First generate default configuration file :
docker run --rm influxdb influxd config > influxdb.confIf you want to enable user authentication on http, enable auth-enabled option in config file:
[http]
...
auth-enabled = true
...Then create an admin user :
docker run --rm --link=influxtest -it influxdb influx -host influxtest -execute "CREATE USER myname WITH PASSWORD '123456' WITH ALL PRIVILEGES"Then run the container:
docker run --name influxtest -d -p 8086:8086 \
-v $PWD:/var/lib/influxdb \
-v $PWD/influxdb.conf:/etc/influxdb/influxdb.conf:ro \
influxdb -config /etc/influxdb/influxdb.confRun influxdb cli client in another container linked to influxtest container:
docker run --rm --link=influxtest -it influxdb influx -host influxtestIf you enable user authentication, authenticate your user first:
authCreate a new database:
CREATE DATABASE <dbname>Show list of databases:
SHOW DATABASESUse a database:
USE <dbname>
@majerus1223 You can use another name instead of
influxtest