So, Docker stacks and container management. I really wanted something fairly minimalist and thought I’d do it myself. The container performance metrics were simple to figure out, but how to group containers by stack or how to check for updates were another thing. Before this, I hadn’t even known that Docker doesn’t use versioning at all and only identifies images by sha256 hashes.
Long story short, while it would be a fun topic to dive into at some point, why reinvent the wheel? There are hundreds of dashboards that either include Docker or show its information exclusively. I’ve tried a couple (such as Portainer) but haven’t found one with a set of features I like. There’s also the issue that most are actually developed as services management suites in swarms rather than comparatively simple home-server dashboards.
Here’s my use case:
- I want to continue maintaining my services through docker-compose all by myself, including manual updates.
- But I’d like to get a dashboard that tells me when a container has received a new update.
- I want some form of usage metrics, such as current CPU load and CPU average over time, with the same for memory, network and IO.
Bonus points for:
- An integration with a notification method for updates, failing health checks, excessive resource usage. Maybe something external like ntfy/Gotify which is easy to use and self-host.
- The (current) metrics should be available both per container, per stack and as a combined total on a single page. I’ve seen how Portainer does it and wasn’t impressed: the need to visit the stats page of every single container isn’t very productive.
What type of dashboard do you use and would your choice be compatible with my requirements/wishes?
I use a combination of Dockge, diun with gotify and Beszel for managing update notifications, stacks and container usage.
It will certainly not fit all of your requirements, but it’s a not too complicated setup which gets me the most important infos.
diun for update notifications and Beszel for the dashboard look pretty good and lightweight. I’ll definitely test then to see how well they suit me. Thanks!
This would be my choice as well, as I went with Dockge exactly because it works with your existing docker-compose files, and there are no issues if you manage with either Dockge or with the terminal.
If you add Ntfy or Gotify then you should be set.
It doesn’t fulfil all your use cases by far but cockpit has an application for docker that has real time monitoring of CPU and memory and some simple management. It is MIT licensed and still very bare bones so it could be a quicker way than starting from scratch.
https://cockpit-project.org/
https://github.com/chrisjbawden/cockpit-dockermanagerThanks for your reply. I like Cockpit, it not only looks appealing but also seems to be just the kind of tool I’d love to use. Since I don’t have a need for its current feature-set though, I’ve starred the project on GitHub and will keep an eye on it as it develops.
I use node_exporter (for machines/VMs) and cAdvisor (for Docker containers) + VictoriaMetrics + AlertManager/Grafana for resource usage tracking, visualization, and alerts.
For updates, I use a combination of dockcheck.sh and OliveTin with some custom wrappers to dynamically build a page with a button for every stack that includes a container with an update. Clicking the button applies the update and cycles the container. Once the container is updated, its button disappears from the page. So just loading the page will tell you how many and which containers have available updates and you can update them whenever you like from anywhere, including your phone/tablet, with one button click. I also have apt updates for VMs and hosts integrated onto this page, so I can update the host machines as well in the same way.
I have a basic understanding of Grafana since we use it at work. It definitely fits the question, but it’s also very much overkill for my purposes - maybe not in the range of features, but definitely in scope.
Your mention of dockcheck.sh is gold! Someone else mentioned diun, but I think this shell script is even better. As long as there’s a simple way to determine which containers use outdated images, I’m good. The metrics part can be solved with a tool like Beszel or I can whip something up myself if I don’t find anything good enough.
As long as there’s a simple way to determine which containers use outdated images, I’m good
Yeah you can either have it update the containers itself, or just print out their names. With a custom plugin you can make it output the names of any containers that have available updates in whatever format you like. This discussion on the github page goes through some example scripts you can use to serve the list of containers with available updates over a REST API to be pulled into any other system you like (eg: Homepage dashboard).