amir20 / dozzle

Realtime log viewer for docker containers.
https://dozzle.dev/
MIT License
5.7k stars 287 forks source link

Fetch docker container/service names periodically #3243

Closed HomelabHaven closed 2 weeks ago

HomelabHaven commented 2 weeks ago

Describe the feature you would like to see

Hello there,

Description of observed behaviour: For more than 24 hours after a built-in portainer business edition update, which creates a" portainer-update" container for that process, the actual portainer container name did not change to its actual value in dozzle.

Not sure if this has to do with browser or reverse proxy caching just thought I'd mention it. :)

Describe how you would like to see this feature implemented

Periodic (every 5 minutes?) scanning and updating of running container/service names.

Describe any alternatives you've considered

Restarting the dozzle container refreshes the names as expected.

amir20 commented 2 weeks ago

I don't understand "portainer container name" means.

I don't think you can change container names without destroying containers and recreating them. So Dozzle watches for created or die events to refresh it's cache.

Is there something else happening? You'll have to do the investigation. typically you can do docker events to see what events trigger.

HomelabHaven commented 2 weeks ago

When I update Portainer (container name: portainer) it creates an additional container for the update process called "portainer-update". After the update process the portainer-update container is destroyed and the now updated portainer container is started. However Dozzle continues to display the incorrect name (portainer-update) for the portainer container. I used "docker inspect" from the cli for the portainer container to get the name and it was correct in comparison to what was displayed in Dozzle before a restart.

amir20 commented 2 weeks ago

Hey @HomelabHaven. You didn't answer my question. I wanted to see what events docker sends with docker events. I don't use portainer and I think the only way to debug this is to set it up myself. But I won't have time to do that.

It also seems only business edition can do this:

From 2.19, Business Edition users are able to update their Portainer installation directly from within Portainer. To do so, click the Update now link in the update notification in the bottom left of the Portainer UI.

Going to close. If anybody else reproduces this then I'll come back to it.