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

docker-gen support detection of container creation/removal in remote nodes over a swarm?

Open 3fr61n opened this issue 8 years ago • 4 comments

Hi

It seems that docker-gen in a multi node swarm only have visibility on containers that resides on the local host machine.

Is there any way to have visibility of what happens on remote nodes that belong to the same swarm?

Regards

3fr61n avatar Dec 12 '17 16:12 3fr61n

@3fr61n checkout my image. It supports Swarm mode.

arefaslani avatar Apr 23 '18 13:04 arefaslani

Any news on this issue?

miesgre avatar Dec 18 '18 11:12 miesgre

I was looking a bit deeper into this issue and found that docker-gen is calling ListContainers function of the client in generator.go module, which returns the list of container from the current host/swarm-node only.

I was thinking it might be possible to get all the containers in the swarm by first getting the list of nodes, then getting the list of containers from each node and finally merging them all in one list. This may fix the problem from the root.

candeemis avatar Apr 16 '23 20:04 candeemis

@candeemis I like your proposal. Do you have time to implement it?

nabheet avatar Jan 01 '24 05:01 nabheet