Membuat directory dengan nama cAdvisor

mkdir -p /monitoring-data/cAdvisor

Membuat file docker-compose.yml didalam folder node-exporter

nano /monitoring-data/cAdvisor/docker-compose.yml

Adapun isi dari docker-compose.yml sebagai berikut :

version: '3.7'
services:
  cadvisor:
    image: gcr.io/cadvisor/cadvisor
    container_name: cadvisor
    restart: always
    volumes:
      - /:/rootfs:ro
      - /var/run:/var/run:rw
      - /sys:/sys:ro
      - /var/lib/docker/:/var/lib/docker:ro
    networks:
      - prometheus-net
networks:
  traefik-net:
    external: true
    name: traefik-net
  prometheus-net:
    name: prometheus-net
    external: true

Menjalankan docker cAdvisor dengan menjalankan perintah docker compose up -d . didalam directory node-exporter

docker compose up -d .

Leave a Reply

Your email address will not be published. Required fields are marked *