Docker Containers: Display non-existing containers as missing
- Dominant language
- Go
- Stars
- 37.1k
- Forks
- 1.5k
- Avg merge
- 1h 11m
- Merged PRs (30d)
- 1
Description
### Description
When configuring the docker container widget, a config file might look like this:
```yaml
pages:
name: Home
- columns:
widgets:
- cache: 30s
category: Monitoring
running-only: false
title: Monitoring
type: docker-containers
containers:
dozzle:
category: Monitoring
description: Container Log Viewer
icon: di:dozzle
name: Dozzle
url: https://dozzle.example.com
```
I am expecting the container to exist, but it will only show up on the Dashboard if it's either running or stopped.
If the container doesn't exist at all, the container won't show up as failing/missing:
This is especially limiting when working with Podman Quadlets. The Quadlet generator will typically generate `ExecStop` and `ExecStopPost` hooks such as:
```ini
ExecStop=/nix/store/xymqb4i2pfxdzr3ban7x289lkfaz7gds-podman-5.4.1/bin/podman rm -v -f -i --cidfile=%t/%N.cid
ExecStopPost=-/nix/store/xymqb4i2pfxdzr3ban7x289lkfaz7gds-podman-5.4.1/bin/podman rm -v -f -i --cidfile=%t/%N.cid
```
A failing service won't leave behind a stopped container, since the container will be removed as well.
Thus, failing services won't be shown on the dashboard.
When configuring containers in the yaml config file, it'd be nice to see expected containers that don't exist as missing.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the docker-containers widget entry point and trace how configured container names are matched against existing containers. Define done as rendering configured containers that are absent as missing, including the Podman Quadlet failure case, and add coverage for an absent container if the widget has tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- devops
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100