FileBeat Not Starting in Custom Dockerfile

We are trying to create a custom Dockerfile which will include FileBeat as well. When the container is started FileBeat should start automatically.

DockerFile

FROM microsoft/aspnetcore:2.0.3

WORKDIR /usr/local/filebeat

RUN curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-6.2.4-amd64.deb
RUN dpkg -i filebeat-6.2.4-amd64.deb

WORKDIR /usr/local/app

ADD docker-entrypoint.sh /usr/local/app/

RUN ["chmod", "+x", "/usr/local/app/docker-entrypoint.sh"]

ENTRYPOINT ["/usr/local/app/docker-entrypoint.sh"]

docker-entrypoint.sh

#!/bin/bash
service filebeat start

The FileBeat service doesn't start. Not sure what are we missing here.
I checked the official Docker Image for FileBeat where the FileBeat service starts automatically when the container is started.

Here is the official entry point script: https://github.com/elastic/beats-docker/blob/master/templates/docker-entrypoint.j2 In docker I would recommend to not start filebeat as but run it directly. Like this you get all logs directly to the output. For this start the beat with -e. In case filebeat fails to start, you will also directly see why.

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