# Filebeat.yml: permission denied while runing in docker

**URL:** <https://discuss.elastic.co/t/filebeat-yml-permission-denied-while-runing-in-docker/208140>\
**Category:** Beats\
**Tags:** docker\
**Created:** [November 15, 2019, 10:06pm UTC](https://discuss.elastic.co/t/filebeat-yml-permission-denied-while-runing-in-docker/208140 "2019-11-15T22:06:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pepper\_Pam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pepper_pam/32/56455_2.png) [@Pepper\_Pam](https://discuss.elastic.co/u/Pepper_Pam)\
**Post date:** [November 15, 2019, 10:06pm UTC](https://discuss.elastic.co/t/filebeat-yml-permission-denied-while-runing-in-docker/208140/1 "2019-11-15T22:06:18Z")

</div>

I have the Dockerfile for filebeat as below:

```auto
FROM docker.elastic.co/beats/filebeat:7.4.2

COPY filebeat.yml /usr/share/filebeat/filebeat.yml

USER root

RUN chown root:filebeat /usr/share/filebeat/filebeat.yml

USER filebeat

```

And I build the image like ` docker build -t filebeat-docker .`  
run the image like `docker run -it --name filebeat-docker-test filebeat-docker`

And I got below error：

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/6/b60a6a6a859e29dd0d66e26ff83ef8dbaafbb4a2.png)

And my filebeat.yml is as below:

```auto
filebeat.inputs:

- type: log
 
  enabled: true
  # Paths that should be crawled and fetched. Glob based paths.
  paths: 
    - /Users/lachen/Documents/n-log/nifi*.log
  tail_files: true

#----------------------------- Kafka output --------------------------------
output.kafka:
  # codec.format:
  # string: '%{[message]}'
  hosts: ["localhost:9092"]
  topic: pam-server-test
  partition.round_robin:
    reachable_only: false
  required_acks: 1
  compression: gzip
  max_message_bytes: 1000000

```

---

<div class="post-metadata">

**Author:** ![kvch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kvch/32/72058_2.png) [@kvch](https://discuss.elastic.co/u/kvch)\
**Post date:** [November 18, 2019, 3:58pm UTC](https://discuss.elastic.co/t/filebeat-yml-permission-denied-while-runing-in-docker/208140/2 "2019-11-18T15:58:08Z")

</div>

Have you tried passing `--strict.perms=false` to Filebeat?

---

<div class="post-metadata">

**Author:** ![Pepper\_Pam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pepper_pam/32/56455_2.png) [@Pepper\_Pam](https://discuss.elastic.co/u/Pepper_Pam)\
**Post date:** [November 18, 2019, 8:26pm UTC](https://discuss.elastic.co/t/filebeat-yml-permission-denied-while-runing-in-docker/208140/3 "2019-11-18T20:26:18Z")

</div>

Hi, How to pass it to Filebeat?  
On run command?  
like below:  
docker container run --strict.perms=false --name filebeat filebeat:1.0.1

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 16, 2019, 10:26pm UTC](https://discuss.elastic.co/t/filebeat-yml-permission-denied-while-runing-in-docker/208140/4 "2019-12-16T22:26:19Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
