"advanced" constraints for docker provider?

I'm interested in the feature described here : Docker - Traefik

I have exposedByDefault set to true and I like that.
Only I have some gitlab runners that ocasionnaly will start runners.
I wasn't able to find a way to tell the gitlab runners that any container they start should have the label traefik.enable set to false, and I can't seem to find any useful label on the containers started by the runners, only the name is always something like this :
runner-efbtb2bm-project-XXX-concurrent-0-112529a7efc9b1fd-predefined-4
So I'd realy like to craft a constraint that would say something like !Name(`runner-*`) as I don't expect to run other containers whose name would start with runner-*

Would someone know if this is indeed possible and what would be the correct syntax ?

Thank you in advance for your kind help,
Regards,
Toxic

1 Like

I would also like to see more powerful constraints. In my use-case, I would like to detect containers either with "any label in the traefik namespace", or with "a specific docker network". Both would work fine with me.

For instance:

# Already existing syntax: 
constraints = "LabelRegex(`a.label.name`, `a.+`)"

# Suggested: Allow "regex" on the "key" and not just the value of the label:
constraints = "LabelKeyRegex(`^traefik\.`, `.*`)"

# Suggested: Find out if a given network is attached to the container (by network name):
constraints = "Network(`traefik`)"

It would be awesome if this could be discussed and specified in order to produce a consistent set of new constraints that satisfies the community's needs.

Thank you!

1 Like