Beat compilation for musl libc / Alpine Linux / Docker containers

It would be great if all beats would be compiled statically to work on musl libc distributions as well. I found (for 5.4.2) that filebeat works nicely on musl libc based distros, metricbeat requires a compatibility layer.

Especially metricbeat is useful in a containerized environment, so I suggest compiling it so that "apk add libc6-compat" is not required.

See ldd:
/etc/metricbeat # ldd /usr/bin/metricbeat
/lib64/ld-linux-x86-64.so.2 (0x56392ef4f000)
libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x56392ef4f000)
libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x56392ef4f000)

/etc/metricbeat # ldd /usr/bin/filebeat
ldd: /usr/bin/filebeat: Not a valid dynamic program

Unfortunately, as soon as Cgo is required, libc must be dynamically compiled, otherwise one gets weird bugs like this one. Metricbeat requires Cgo for reading some process information, and in the future for custom plugins.

The only viable solution static binaries and Cgo seems to be compiling against musl-libc, which we plan to try out, but there are worrying experiences about that as well.

Note that we currently provide official Docker images, based on Centos.

Thanks for the heads up - I didn't see the blog entry until now.
Maybe it's time to move on?
The ideal setup though probably should be (at least for our use case):
Getting a static build of the beats working in Alpine Linux (because we have hundreds of very small containers running on Alpine and have the rest of Elastic Stack on CentOS.

That's what we are currently doing anyway, so I am looking forward to running the beats on Alpine, not the rest of the stack.

Thanks for all the work,

Tom

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