Docker-Socket-Proxy & glances reddit / selfhosted ---------------------------------------------------------------------- Volitanic · 2023-10-28 03:28 Has anyone been able to get glances to show container metrics when going through docker socket proxy? I tried enabling every flag listed on the socket proxy GitHub but glances still won't show containers. It reports them just fine if I go directly to the socket. Thanks! ---------------------------------------------------------------------- thekrautboy · 2023-10-28 06:47 A socket connection is not identical to a TCP/HTTP connection. You cant just simply replace it. Glances needs to support accessing Docker over HTTP instead of the typical socket. If it doesnt support it, you cant use it. ---------------------------------------------------------------------- psychowood · 2023-10-28 12:50 My glances instance is quite plain: `admin-glances:` `container_name: glances` `restart: always` `environment:` `- GLANCES_OPT=-w` `volumes:` `- './glances/glances.conf:/glances/conf/glances.conf'` `- '/var/run/docker.sock:/var/run/docker.sock:ro'` `pid: host` `image: 'nicolargo/glances:latest-full'` `labels:` `- "traefik.enable=true"` `networks:` `reverse-proxy:` paired with a basically emtpy docker section in the configuration: `[docker]` `disable=False` `max_name_size=20` `all=False` and it shows all the container data without problems. I''d guess you just need to forward `docker.sock` and you should be good to go as long your `docker.disable` flag is not set to true ---------------------------------------------------------------------- psychowood · 2023-10-28 14:16 Since I was feeling bad for giving the wrong answer in another comment, I spin up a docker socket proxy and did some test :) The main points are: * add DOCKER\_HOST variable pointing to your tcp socket * add CONTAINERS=1 variable in docker-socker-proxy to allow reading containers, otherwise it will fails silently (unless you run glances with -d) with a 403 Here's a sample compose file, adjust to your needs. Please note that the tcp socket is not exposed outside of `admin_net` network and that glances does not have access to the `docker.sock` socket: version: '3.3' services: admin-glances: container_name: glances restart: always ports: - '61208:61208' environment: - GLANCES_OPT=-w - DOCKER_HOST=tcp://dockerproxy:2375 volumes: - './glances/glances.conf:/glances/conf/glances.conf' # - '/var/run/docker.sock:/var/run/docker.sock:ro' pid: host image: 'nicolargo/glances:latest-full' networks: admin_net: admin-docker-socket-proxy: container_name: dockerproxy hostname: dockerproxy image: tecnativa/docker-socket-proxy environment: - CONTAINERS=1 volumes: - '/var/run/docker.sock:/var/run/docker.sock:ro' # ports: # - '2375:2375' networks: admin_net: networks: admin_net: name: admin_net ---------------------------------------------------------------------- Volitanic · 2023-10-28 15:49 OMG...Instead of the env variable DOCKER\_HOST: tcp://dockerproxy:2375 I had hostname: tcp://dockerproxy:2375 in there which only changed the website title. So dumb. Everything else was the same as your example. Thanks for the help!