RE: /usr/local/bin/docker-entrypoint: line 8: exec: filebeat: not found

I basically have the same problem as this other topic, but I am reposting it since no solution was found.

Deploying filebeats via docker-compose produces the following error:

/usr/local/bin/docker-entrypoint: line 8: exec: filebeat: not found /usr/local/bin/docker-entrypoint: line 8: exec: filebeat: not found /usr/local/bin/docker-entrypoint: line 8: exec: filebeat: not found /usr/local/bin/docker-entrypoint: line 8: exec: filebeat: not found /usr/local/bin/docker-entrypoint: line 8: exec: filebeat: not found /usr/local/bin/docker-entrypoint: line 8: exec: filebeat: not found /usr/local/bin/docker-entrypoint: line 8: exec: filebeat: not found

I am using a custom image, here's the content of my Dockerfile:

FROM docker.elastic.co/beats/filebeat:7.0.0
COPY filebeat.docker.yml /usr/share/filebeat/filebeat.yml
USER root
RUN chown -R root:root /usr/share/filebeat
RUN chmod go-w /usr/share/filebeat/filebeat.yml
RUN chmod a+rx /usr/share/filebeat/filebeat

and my docker-compose.yml:

version: '2.1'

services:

  filebeat:
    image: <filebeat image built from Dockerfile>
    labels:
      - co.elastic.logs/disable=true
    networks:
      net:
        ipv4_address: 192.168.0.16
    restart: always
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /var/lib/docker/containers:/usr/share/filebeat/dockerlogs:ro

  logstash:
    image: <custom logstash image>
    labels:
      - co.elastic.logs/disable=true
    networks:
      net:
        ipv4_address: 192.168.0.17
    restart: always

networks:
  net:
    driver: bridge
    enable_ipv6: false
    ipam:
      driver: default
      config:
        - subnet: 192.168.0.0/24
          gateway: 192.168.0.254

All images are fetched from a private registry.

N.B.: running the same image with docker run works fine:

docker run -v /var/run/docker.sock:/var/run/docker.sock:ro -v /var/lib/docker/containers:/usr/share/filebeat/dockerlogs:ro <custom filebeat image>

Hello @Michele_Chersich,

Kindly provide your complete docker-compose.yml with </>

The entire compose file does not fit in the description. I included one container and the network.

For some reason filebeat's home directory is not in PATH.
Overriding the default entrypoint solves the issue:

entrypoint: bash -c 'export PATH=$PATH:/usr/share/filebeat && /usr/local/bin/docker-entrypoint -e'

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