使用docker-compose部署(下述environment内容为结果存储的influxdb的信息):

version: '2'
services:
  cadvisor:
    image: google/cadvisor:latest
    container_name: cadvisor
    restart: unless-stopped
    environment:
      storage_driver_host: 192.168.8.197:8086
      storage_driver_db: cadvisor
      storage_driver_user: root
      storage_driver_password: 123456
    command: -storage_driver=influxdb -storage_driver_db=cadvisor -storage_driver_host=192.168.8.197:8086
    ports:
      - 12345:8080
    volumes:
      - /:/rootfs:ro
      - /var/run:/var/run:rw
      - /sys:/sys:ro
      - /var/lib/docker/:/var/lib/docker:ro

1、启动:docker-compose up -d cadvisor
2、可视化:访问http://主机ip:8080/,显示相关信息
3、验证:docker stats,此命令可查看容器信息

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐