# Static build

**URL:** <https://discuss.elastic.co/t/static-build/34354>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [November 11, 2015, 9:52pm UTC](https://discuss.elastic.co/t/static-build/34354 "2015-11-11T21:52:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mterron](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@mterron](https://discuss.elastic.co/u/mterron)\
**Post date:** [November 11, 2015, 9:52pm UTC](https://discuss.elastic.co/t/static-build/34354/1 "2015-11-11T21:52:48Z")

</div>

Can we get a statically compiled binary instead of the current dynamic linked one? I'd like to use Filebeat on a non glibc based system.

This is what the current x86-64 binary looks like:  
ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, not stripped

This is what a working golang app looks like on my system:  
ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped

Thanks

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [November 12, 2015, 1:38am UTC](https://discuss.elastic.co/t/static-build/34354/2 "2015-11-12T01:38:54Z")

</div>

Yeah, we should be able to provide a statically linked binary. It is interesting that the binary is dynamically linked. That must be caused by the way it gets built through [beats-packer](https://github.com/elastic/beats-packer). When using the straight [`make crosscompile`](https://github.com/elastic/filebeat/blob/master/Makefile#L67) target for the project it generates mostly all statically linked binaries.

```auto
$ make crosscompile
$ cd bin
$ file *
filebeat-darwin-386: Mach-O i386 executable
filebeat-darwin-amd64: Mach-O 64-bit x86_64 executable
filebeat-dragonfly-amd64: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped
filebeat-freebsd-386: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), statically linked, not stripped
filebeat-freebsd-amd64: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), statically linked, not stripped
filebeat-freebsd-arm: ELF 32-bit LSB executable, ARM, EABI5 version 1 (FreeBSD), statically linked, not stripped
filebeat-linux-386: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, not stripped
filebeat-linux-386-387: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, not stripped
filebeat-linux-amd64: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped
filebeat-linux-arm: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, not stripped
filebeat-linux-arm-arm5: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, not stripped
filebeat-linux-arm64: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, not stripped
filebeat-linux-ppc64: ELF 64-bit MSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), statically linked, not stripped
filebeat-linux-ppc64le: ELF 64-bit LSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), statically linked, not stripped
filebeat-netbsd-386: ELF 32-bit LSB executable, Intel 80386, version 1 (NetBSD), statically linked, for NetBSD 5.99, not stripped
filebeat-netbsd-amd64: ELF 64-bit LSB executable, x86-64, version 1 (NetBSD), statically linked, for NetBSD 5.99, not stripped
filebeat-netbsd-arm: ELF 32-bit LSB executable, ARM, version 1 (NetBSD), statically linked, for NetBSD 5.99, not stripped
filebeat-openbsd-386: ELF 32-bit LSB executable, Intel 80386, version 1 (OpenBSD), statically linked, for OpenBSD, not stripped
filebeat-openbsd-amd64: ELF 64-bit LSB executable, x86-64, version 1 (OpenBSD), statically linked, for OpenBSD, not stripped
filebeat-openbsd-arm: ELF 32-bit LSB executable, ARM, version 1 (OpenBSD), statically linked, for OpenBSD, not stripped
filebeat-solaris-amd64: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/amd64/ld.so.1, not stripped
filebeat-windows-386.exe: PE32 executable (console) Intel 80386 (stripped to external PDB), for MS Windows
filebeat-windows-amd64.exe: PE32+ executable (console) x86-64 (stripped to external PDB), for MS Windows

```

Looking at the binary from the download site I get:

```auto
$ curl https://download.elastic.co/beats/filebeat/filebeat-1.0.0-rc1-x86_64.tar.gz | tar xzv^C
$ file filebeat-1.0.0-rc1-x86_64/filebeat
filebeat-1.0.0-rc1-x86_64/filebeat: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, not stripped

```

I created the issue below to track the problem. In the meantime you could download a binary from [S3](https://beats-nightlies.s3.amazonaws.com/index.html?prefix=jenkins/filebeat/), which has binaries for each change to the master branch.

> <https://github.com/elastic/beats-packer/issues/23>

---

<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:** [July 5, 2017, 9:58pm UTC](https://discuss.elastic.co/t/static-build/34354/3 "2017-07-05T21:58:08Z")

</div>


