部署 influxDB
首先,pull influxBD
镜像(拉取是1.8的版本,虽有2.0+的版本,但我还是喜欢站在巨人的肩头前行…):
debugfeng@debugfeng:~$ sudo docker pull influxdb:1.8
1.8: Pulling from library/influxdb
1671565cc8df: Pull complete
3e94d13e55e7: Pull complete
fa9c7528c685: Pull complete
52a25ba52346: Pull complete
aa26e2239d02: Pull complete
0ab001de8b69: Pull complete
610b13a73459: Pull complete
4de10ef52d67: Pull complete
Digest: sha256:4e3d30d9d00798581a820d19ff762ce000a217498e2e00b361ca334595f1f515
Status: Downloaded newer image for influxdb:1.8
docker.io/library/influxdb:1.8
其次,docker run ...
,启动容器并运行:
debugfeng@debugfeng:~$ sudo docker run -itd -p 8083:8083 -p 8086:8086 --name my-influxdb influxdb:1.8
caf829d4fb272c2f9cf856022fe534e8ad5f0d507be9d150e6f590692fe5a59b
debugfeng@debugfeng:~$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
caf829d4fb27 influxdb:1.8 "/entrypoint.sh infl…" 5 seconds ago Up 4 seconds 0.0.0.0:8083->8083/tcp, :::8083->8083/tcp, 0.0.0.0:8086->8086/tcp, :::8086->8086/tcp my-influxdb
最后,docker exec -it ... /bin/bash
,进入指定容器,启动并创建数据库:
debugfeng@debugfeng:~$