# FileBeat Not Starting in Custom Dockerfile

**URL:** https://discuss.elastic.co/t/filebeat-not-starting-in-custom-dockerfile/129901
**Category:** Beats
**Tags:** filebeat
**Created:** [April 28, 2018, 4:33am UTC](https://discuss.elastic.co/t/filebeat-not-starting-in-custom-dockerfile/129901 "2018-04-28T04:33:37Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![code\_blue](https://avatars.discourse-cdn.com/v4/letter/c/7ea924/32.png) [@code\_blue](https://discuss.elastic.co/u/code_blue)
#### Post date: [April 28, 2018, 4:33am UTC](https://discuss.elastic.co/t/filebeat-not-starting-in-custom-dockerfile/129901/1 "2018-04-28T04:33:37Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)
#### Post date: [April 30, 2018, 7:32am UTC](https://discuss.elastic.co/t/filebeat-not-starting-in-custom-dockerfile/129901/2 "2018-04-30T07:32:07Z")

</div>

Here is the official entry point script: [https://github.com/elastic/beats-docker/blob/master/templates/docker-entrypoint.j2](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.

---

<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: [May 28, 2018, 7:43am UTC](https://discuss.elastic.co/t/filebeat-not-starting-in-custom-dockerfile/129901/3 "2018-05-28T07:43:55Z")

</div>

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