docker-gen icon indicating copy to clipboard operation
docker-gen copied to clipboard

Feature request: Filter and ignore Containers.

Open DamionWaltermeyer opened this issue 9 years ago • 3 comments

Please make my boss happy. ^_^

[1:27 PM]
Boss: I’m looking harder at docker-gen as the cause of many of our woes think it’d be an easy fix if true, but would probably require changes to the source

[1:27 PM]
dwaltermeyer What do you think the issue is?

[1:27 PM]
Boss: it gets notified about everything that happens so, on a busy server like sp5(hundreds of "tiny containers"), that’s a lot of events.

Even stopping "Our container than governs multiple tiny containers", docker-gen is still dealing with a backlog of events three or four minutes later.

It only regenerates and pokes nginx when a container with a VIRTUAL_HOST env param comes or goes but I think when a new "tiny-container" comes along, it inspects every container to build its map of what’s out there bottom line is I want it to be able to filter out and ignore containers that start with "tiny-container-name" and I want it to only receive container events not network events, volume events, and everything else that its getting bombarded with and has to throw away

docker-gen is the heart of nginx-proxy-helper so it gets a ton of events for containers that come and go that don’t touch the nginx config

Thanks in advance to anyone capable and willing to tackle this.

DamionWaltermeyer avatar Sep 07 '16 19:09 DamionWaltermeyer

That looks feasible. The Docker events API has some filters that can be specified to reduce events. It looks like a lot more events are sent now than when docker-gen was first written so that is likely why it's getting so many and getting backlogged. docker-gen really only looks at container events for start, die, etc.. but, it looks like that could be done from the API directly via filters={"event"="<string>"}

jwilder avatar Sep 07 '16 21:09 jwilder

Thanks for the reply. We'd like to do the opposite of docker api filtering. If I'm understanding it, docker api filters display only that event(inclusive), but I'd like to do something exclusionary for docker-gen's intake so it won't get bogged down. In our use case, we have hundreds of containers per host with the majority of them being containers with the same prefix that we don't need and a wide variety of remaining containers we'd like to include. Thanks again.

DamionWaltermeyer avatar Sep 07 '16 21:09 DamionWaltermeyer

This is actually an issue with running gitlab-runner on the same host as the docker-gen container.

JanMalte avatar Feb 20 '23 21:02 JanMalte