# How cloud I build the filebeat image after change some code in beats/libbeat?

**URL:** <https://discuss.elastic.co/t/how-cloud-i-build-the-filebeat-image-after-change-some-code-in-beats-libbeat/288278>\
**Category:** Beats\
**Tags:** docker, filebeat\
**Created:** [November 3, 2021, 3:11am UTC](https://discuss.elastic.co/t/how-cloud-i-build-the-filebeat-image-after-change-some-code-in-beats-libbeat/288278 "2021-11-03T03:11:16Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Icedroid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/icedroid/32/93608_2.png) [@Icedroid](https://discuss.elastic.co/u/Icedroid)\
**Post date:** [November 3, 2021, 3:11am UTC](https://discuss.elastic.co/t/how-cloud-i-build-the-filebeat-image-after-change-some-code-in-beats-libbeat/288278/1 "2021-11-03T03:11:16Z")

</div>

I have add following code in the file beats/libbeat/kafka/config.go:

```auto
if config.EnableIdempotent {
		k.Producer.Idempotent = true
		k.Net.MaxOpenRequests = 1
		k.Producer.RequiredAcks = sarama.WaitForAll
}

```

Now I don't know How to build a filebeat docker image for me? Who cloud help for me. Thanks very much.

---

<div class="post-metadata">

**Author:** ![Icedroid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/icedroid/32/93608_2.png) [@Icedroid](https://discuss.elastic.co/u/Icedroid)\
**Post date:** [November 4, 2021, 1:14am UTC](https://discuss.elastic.co/t/how-cloud-i-build-the-filebeat-image-after-change-some-code-in-beats-libbeat/288278/2 "2021-11-04T01:14:02Z")

</div>

@ [ChrsMark](https://discuss.elastic.co/u/ChrsMark)

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [November 8, 2021, 9:01am UTC](https://discuss.elastic.co/t/how-cloud-i-build-the-filebeat-image-after-change-some-code-in-beats-libbeat/288278/3 "2021-11-08T09:01:34Z")

</div>

Hey @Icedroid,

You can build a docker image from source running the following command from the filebeat directory:

```auto
PACKAGES="docker" PLATFORMS="linux/amd64" mage package

```

---

<div class="post-metadata">

**Author:** ![legoguy1000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/legoguy1000/32/54301_2.png) [@legoguy1000](https://discuss.elastic.co/u/legoguy1000)\
**Post date:** [November 8, 2021, 12:48pm UTC](https://discuss.elastic.co/t/how-cloud-i-build-the-filebeat-image-after-change-some-code-in-beats-libbeat/288278/4 "2021-11-08T12:48:00Z")

</div>

@jsoriano what would be the parameters for .Deb/.rpm packaging? Is it documented somewhere?

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [November 8, 2021, 1:07pm UTC](https://discuss.elastic.co/t/how-cloud-i-build-the-filebeat-image-after-change-some-code-in-beats-libbeat/288278/5 "2021-11-08T13:07:27Z")

</div>

I couldn't find documentation 🤔 Package types are defined in [beats/pkgtypes.go at 3d19ec04aaf73b20eafb9d5283a43c17543d8b4f · elastic/beats · GitHub](https://github.com/elastic/beats/blob/3d19ec04aaf73b20eafb9d5283a43c17543d8b4f/dev-tools/mage/pkgtypes.go)

For deb/rm it would be `deb` or `rpm`, or `deb,rpm` for both.

Not setting `PACKAGES` builds all the available packages for each selected platform.

---

<div class="post-metadata">

**Author:** ![legoguy1000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/legoguy1000/32/54301_2.png) [@legoguy1000](https://discuss.elastic.co/u/legoguy1000)\
**Post date:** [November 8, 2021, 6:33pm UTC](https://discuss.elastic.co/t/how-cloud-i-build-the-filebeat-image-after-change-some-code-in-beats-libbeat/288278/6 "2021-11-08T18:33:19Z")

</div>

Awesome, thanks.

---

<div class="post-metadata">

**Author:** ![Icedroid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/icedroid/32/93608_2.png) [@Icedroid](https://discuss.elastic.co/u/Icedroid)\
**Post date:** [November 10, 2021, 12:29pm UTC](https://discuss.elastic.co/t/how-cloud-i-build-the-filebeat-image-after-change-some-code-in-beats-libbeat/288278/7 "2021-11-10T12:29:06Z")

</div>

> [@jsoriano](#):
>
> ```auto
> PACKAGES="docker" PLATFORMS="linux/amd64" mage package
> 
> ```

Thanks very much. help for me.

---

<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 8, 2021, 2:30pm UTC](https://discuss.elastic.co/t/how-cloud-i-build-the-filebeat-image-after-change-some-code-in-beats-libbeat/288278/8 "2021-12-08T14:30:02Z")

</div>

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