You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+55-10Lines changed: 55 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,14 +15,58 @@ Combined with a socket-proxy container that provides granular endpoint access it
15
15
16
16
### Container Filtering
17
17
18
-
#### `CONTAINER_NAMES`
18
+
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):
19
19
20
-
Using this ENV changes Docker API responses:
20
+
* 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
21
+
* 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
21
22
22
-
* 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.
23
-
* 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`
23
+
#### Filters
24
24
25
-
#### `SCRUB_ENVS`
25
+
If a container matches **any** of these filters then it is valid and will be returned.
26
+
27
+
##### `CONTAINER_NAMES`
28
+
29
+
A comma-delimited list of values that a Container's name may include. Any value that matches will cause a Container to be valid.
30
+
31
+
Example
32
+
33
+
```
34
+
CONTAINER_NAMES=foo,bar
35
+
36
+
Containers:
37
+
38
+
* myproject-foo-1 <-- valid
39
+
* coolthingbar-2 <-- valid
40
+
* other-container <-- invalid
41
+
```
42
+
43
+
##### `CONTAINER_LABELS`
44
+
45
+
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.
46
+
47
+
* If a filter is **only** a key (no `=`) then any Container label key that includes the string will match, regardless of value
48
+
* If a filter is a full key-value (`my.label=value`) then
49
+
* Container label key must include filter key
50
+
* Container label value must include filter value
51
+
52
+
Example
53
+
54
+
```
55
+
CONTAINER_LABELS=myfoo,com.bar=fun
56
+
57
+
Container A's labels
58
+
* something=cool <-- invalid
59
+
* com.something=nice <-- invalid
60
+
* com.bar=fun <-- valid
61
+
62
+
Container B's labels
63
+
* something=cool <-- invalid
64
+
* com.myfoo.aaa=yo <-- valid
65
+
* com.myfoo.bbb=hey <-- valid
66
+
* com.bar=sad <-- invalid
67
+
```
68
+
69
+
#### `SCRUB_ENVS` Modifier
26
70
27
71
When `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.
28
72
@@ -133,9 +177,10 @@ Forbidden
133
177
134
178
All configuration is done through environmental variables.
|`PROXY_URL`| yes || The fully-qualified URL to proxy API requests EX `http://socket-proxy:2375`|
183
+
|`CONTAINER_NAMES`| no || A comma-delimited list of values to compare against a container name. |
184
+
|`CONTAINER_LABELS`| no || A comma-delimited list of key-values to compare against container labels. |
185
+
|`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 |
|`PROXY_URL`| yes || The fully-qualified URL to proxy API requests EX `http://socket-proxy:2375`|
140
-
|`CONTAINER_NAMES`| yes || A comma-delimited list of values. Any container that contains any value as a substring will be allowed. |
141
-
|`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 |
0 commit comments