Install Glances in Docker
Introduction to Glances
There are many configurable widgets in Dashy, among which the most practical one is resource monitoring. Displaying CPU usage on the panel is not useful for me —— I am more concerned about which program is causing high CPU usage. However, the Glances software on which this feature depends is very practical.
Glances is similar to the top
command, which can display system resource usage. However, it is better in the following aspects:
- More comprehensive and user-friendly data display;
- It can display the resource usage of each container —— in this respect, it surpasses Portainer. Portainer can only display the resource usage of one container in chart form.
- It can run in server mode. We can monitor resource usage through a browser, which is very convenient.
Glances is relatively lightweight, only displaying the current resource situation without recording historical data. And what I need is precisely this kind of lightweight yet comprehensive resource monitoring software.
Docker Installation
Why use Docker for installation? The official preferred method is to install via pip:
1 | pip install --user glances |
This will disrupt the local Python environment, so let’s use Docker instead.
docker compose:
1 | services: |
Then visit port 61208 in your browser.