Filebeat.yml: permission denied while runing in docker

I have the Dockerfile for filebeat as below:

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:

And my filebeat.yml is as below:

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

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

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

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