Tecnativa / docker-socket-proxy

Proxy over your Docker socket to restrict which requests it accepts
Apache License 2.0
1.3k stars 156 forks source link

Possible to apply container label to all containers started through the proxy? #85

Open yabberyabber opened 1 year ago

yabberyabber commented 1 year ago

Hey folks, is it possible for the docker-socket-proxy to mutate requests as it proxies them? I'm hoping that I can mutate requests to create containers by adding an additional container label. That way it's easy to query/search for containers on the host that were started via a particular proxy instance.

My use-case is that we have an application that may start/stop docker containers during its normal operation, but we want to be able to detect/mitigate container leaks (this application may forget it started a docker container or it may terminate before cleaning these containers up). I'm hoping that we can run an instance of docker-socker-proxy with a hook that adds a label to all container creations. This would effectively namespace the containers started by our application so they can be monitored programmatically.