Skip to content

Commit c6ff74c

Browse files
authored
linux-capability: add note for using CAP_DAC_READ_SEARCH in docker container (#523)
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
1 parent 3fd191f commit c6ff74c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

deployment/linux-capability.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,19 @@ Fluentd, which is running by a non-root user, does not complain with `Permission
181181

182182
If this article is incorrect or outdated, or omits critical information, please [let us know](https://github.com/fluent/fluentd-docs-gitbook/issues?state=open). [Fluentd](http://www.fluentd.org/) is an open-source project under [Cloud Native Computing Foundation \(CNCF\)](https://cncf.io/). All components are available under the Apache 2 License.
183183

184+
## Capability handling on docker container
185+
If you would like to collect logs from a file as a non-root user, you can use `CAP_DAC_READ_SEARCH` Linux capabilities.
186+
However, `CAP_DAC_READ_SEARCH` now cannot be used on docker container by default.
187+
188+
When using `CAP_DAC_READ_SEARCH` in a Docker container, you need to add the `--cap-add DAC_READ_SEARCH` option to the `docker run` command.
189+
Or, if you are using `docker compose`, you need to add `cap_add` to the service definition.
190+
191+
```yml
192+
cap_add:
193+
- DAC_READ_SEARCH
194+
```
195+
196+
Please refer to the Docker documentation for more information:
197+
198+
- [Runtime privilege and Linux capabilities](https://docs.docker.com/engine/containers/run/#runtime-privilege-and-linux-capabilities)
199+
- [cap_add](https://docs.docker.com/reference/compose-file/services/#cap_add)

0 commit comments

Comments
 (0)