running InfluxDB in a container over a network 1

running InfluxDB in a container over a network

docker run -d --name=influxdb \
 -p 8086:8086 \
 -v  /tmp/testdata/influx:/root/.influxdb2 \
      --net=influxdb-telegraf-net \
      influxdb:2.0

Here is what the above code is Doing:
1. Create a network called influxdb-telegraf-net
2. Create a container called influxdb and run it in the background
3. Map the port 8086 on the host to the port 8086 on the container
4. Map the volume /tmp/testdata/influx on the host to the volume /root/.influxdb2 on the container
5. Connect the container to the network influxdb-telegraf-net
6. Use the image influxdb:2.0

Similar Posts