nicolargo/glances
Monitor all yours containers with this standalone Glances container (UI: console / Web + API)
50M+
Glances containers are availables. You can use it to monitor your server and all your other containers !
Pull the full developement version:
docker pull nicolargo/glances:alpine-dev
Then run the container in console mode:
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:ro -v /run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro --pid host --network host -it nicolargo/glances:latest
Or run the container in web ui mode:
docker run -d --restart="always" -p 61208-61209:61208-61209 -e GLANCES_OPT="-w" -v /var/run/docker.sock:/var/run/docker.sock:ro -v /run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro --pid host nicolargo/glances:latest
Get the Glances container:
docker pull nicolargo/glances:<version>
Available tags:
You can also specify a version (example: 3..4.0).
Pull the latest full version:
docker pull nicolargo/glances:latest-full
Then run the container in console mode:
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host --network host -it nicolargo/glances:latest-full
Run the container in Web server mode (notice the GLANCES_OPT
environment variable setting parameters for the glances startup command):
docker run -d --restart="always" -p 61208-61209:61208-61209 -e GLANCES_OPT="-w" -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host nicolargo/glances:latest-full
Alternatively, you can specify something along the same lines with docker run options:
docker run -v `pwd`/glances.conf:/glances/conf/glances.conf -v /var/run/docker.sock:/var/run/docker.sock:ro -v /run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro --pid host -it nicolargo/glances:latest-full
Where `pwd`/glances.conf is a local directory containing your glances.conf file.
Additionally, if you want to use your own glances.conf file, you can create your own Dockerfile:
FROM nicolargo/glances:latest
COPY glances.conf /glances/conf/glances.conf
CMD python -m glances -C /glances/conf/glances.conf $GLANCES_OPT
Complete the steps mentioned in the docker docs <https://docs.docker.com/config/containers/resource_constraints/#gpu>
_
to make the GPU accessible by the docker engine.
With docker run
Include the --gpus
flag with the docker run
command.
Note: Make sure the --gpus
is present before the image name in the command, otherwise it won't work.
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:ro -v /run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock:ro --gpus --pid host --network host -it docker.io/nicolargo/glances:latest-full
With docker-compose
Include the deploy
section in compose file as specified below in the example service definition.
version: '3'
services:
monitoring:
image: nicolargo/glances:latest-full
pid: host
network_mode: host
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /run/user/1000/podman/podman.sock:/run/user/1000/podman/podman.sock
environment:
- "GLANCES_OPT=-w"
# For nvidia GPUs
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
docker pull nicolargo/glances