Profile picture

[Docker] 시스템 리소스 모니터링 - Glances

JaehyoJJAng2023년 05월 22일

◾️ Glances

image


▪️ Docker run

docker run -d --restart="unless-stopped" \
-p 61208-61209:61208-61209 \
-e TZ="Asia/Seoul" \
-e GLANCES_OPT="-w" \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
--pid host \
joweisberg/glances:latest

▪️ Docker Compose

~/glances/docker-compose.yaml

version: "3.8"
services:
  glances:
    container_name: glances
    image: joweisberg/glances:latest
    restart: always
    pid: host
    ports:
      - "61208:61208"
    environment:
      - TZ=Asia/Seoul
      - GLANCES_OPT=--webserver
    volumes:
      - type: bind
        source: /var/run/docker.sock
        target: /var/run/docker.sock:ro
      - type: bind
        source: ./conf
        target: /glances/conf
    networks:
      - "glances-net"

networks:
  glances-net:
    driver: bridge
    external: false

컨테이너 실행

docker-compose up -d --build

▪️ 접속

http://localhost:61208 OR http://<serverip>:61208
image


Loading script...