···15151616### Container Filtering
17171818-#### `CONTAINER_NAMES`
1818+DPF can modify the responses returned from the Docker API for any [Container related endpoint](https://docs.docker.com/reference/api/engine/version/v1.48/#tag/Container):
1919+2020+* Filters [List Containers](https://docs.docker.com/reference/api/engine/version/v1.48/#tag/Container/operation/ContainerList) responses so any container that does not match filters is excluded from the return list
2121+* Any other [Container](https://docs.docker.com/reference/api/engine/version/v1.48/#tag/Container) endpoints will return 404 if it does not match a filter
2222+2323+#### Filters
2424+2525+If a container matches **any** of these filters then it is valid and will be returned.
2626+2727+##### `CONTAINER_NAMES`
2828+2929+A comma-delimited list of values that a Container's name may include. Any value that matches will cause a Container to be valid.
3030+3131+Example
3232+3333+```
3434+CONTAINER_NAMES=foo,bar
19352020-Using this ENV changes Docker API responses:
3636+Containers:
21372222-* Filters [List Containers](https://docs.docker.com/reference/api/engine/version/v1.48/#tag/Container/operation/ContainerList) responses so any container with a name that does not include a value from `CONTAINER_NAMES` is removed.
2323-* Any other [Container](https://docs.docker.com/reference/api/engine/version/v1.48/#tag/Container) endpoints will return 404 if the container name does not include a value from `CONTAINER_NAMES`
3838+* myproject-foo-1 <-- valid
3939+* coolthingbar-2 <-- valid
4040+* other-container <-- invalid
4141+```
24422525-#### `SCRUB_ENVS`
4343+##### `CONTAINER_LABELS`
4444+4545+A comma-delimited list of labels with optional values (key-value) that any of a Container's labels may include. Any value that matches will cause a Container to be valid.
4646+4747+* If a filter is **only** a key (no `=`) then any Container label key that includes the string will match, regardless of value
4848+* If a filter is a full key-value (`my.label=value`) then
4949+ * Container label key must include filter key
5050+ * Container label value must include filter value
5151+5252+Example
5353+5454+```
5555+CONTAINER_LABELS=myfoo,com.bar=fun
5656+5757+Container A's labels
5858+* something=cool <-- invalid
5959+* com.something=nice <-- invalid
6060+* com.bar=fun <-- valid
6161+6262+Container B's labels
6363+* something=cool <-- invalid
6464+* com.myfoo.aaa=yo <-- valid
6565+* com.myfoo.bbb=hey <-- valid
6666+* com.bar=sad <-- invalid
6767+```
6868+6969+#### `SCRUB_ENVS` Modifier
26702771When `true` any responses from the [Container Inspect](https://docs.docker.com/reference/api/engine/version/v1.48/#tag/Container/operation/ContainerInspect) endpoint will have `Config.Env` set to an empty array. This prevents leaking of sensitive `environment:`/`-e` variables that you passed to your container, over the network.
2872···133177134178All configuration is done through environmental variables.
135179180180+| Key | Required | Default | Description |
181181+|--------------------|----------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
182182+| `PROXY_URL` | yes | | The fully-qualified URL to proxy API requests EX `http://socket-proxy:2375` |
183183+| `CONTAINER_NAMES` | no | | A comma-delimited list of values to compare against a container name. |
184184+| `CONTAINER_LABELS` | no | | A comma-delimited list of key-values to compare against container labels. |
185185+| `SCRUB_ENVS` | no | false | Remove `Env` list from [container inspect API](https://docs.docker.com/reference/api/engine/version/v1.48/#tag/Container/operation/ContainerInspect) response |
136186137137-| Key | Required | Default | Description |
138138-|-------------------|----------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
139139-| `PROXY_URL` | yes | | The fully-qualified URL to proxy API requests EX `http://socket-proxy:2375` |
140140-| `CONTAINER_NAMES` | yes | | A comma-delimited list of values. Any container that contains any value as a substring will be allowed. |
141141-| `SCRUB_ENVS` | no | false | Remove `Env` list from [container inspect API](https://docs.docker.com/reference/api/engine/version/v1.48/#tag/Container/operation/ContainerInspect) response |