Running Glances in Docker container and can't see other docker container stats.

2,357 views
Skip to first unread message

Matt Bridges

unread,
Jun 8, 2020, 6:32:14 AM6/8/20
to Glances Users
Hi,
I'm running glances in a container with the following docker compose yaml. 
 monitoring:
    image: nicolargo/glances:latest-alpine
    restart: always
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - "GLANCES_OPT=-w"
    ports:
      - "61208:61208"

I'd like glances to monitor and show stats for the other docker containers I am running but it only does that if I install glances on my host with pip install glances. Is there a way for the docker container glances to monitor the other docker container? 
Thanks,
Matt

Tom Clerehan

unread,
Aug 2, 2020, 8:19:23 AM8/2/20
to Glances Users
I'm running into the same issue when using docker-compose - no container stats visible in the web interface. However, if I use docker-run with the same parameters, it works as expected.

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host --network host -it docker.io/nicolargo/glances

Compared to the compose file:

  glances:
    container_name: glances
    image: nicolargo/glances:latest-alpine
    restart: always
    pid: host
    network_mode: host
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /home/user/.docker/glances:/glances/conf
    environment:
      - "GLANCES_OPT=-w"

Have tried with "61208:61208" as "network_mode: host" in the compose file, but no difference. 

Matt Bridges

unread,
Aug 4, 2020, 4:14:13 PM8/4/20
to Glances Users
Same here but not found a solution yet...

Tom Clerehan

unread,
Aug 4, 2020, 8:32:55 PM8/4/20
to Glances Users
Forgot to mention that the same issue applies to net stats; visible when running in CLI but not in the webUI.

Would really love a simple fix to this, it looks like I could work around it with some Grafana/influxdb setup but I was hoping to use Glances standalone to avoid adding that much more complexity to my environment.
Reply all
Reply to author
Forward
0 new messages