Hello,
I am facing the below error while trying to get elixir binary working on Oracle linux 8.5 , unfortunately we cannot compile on the target server and we are using docker on Windows to build it , so any idea which docker image best to be utilized ?
/opt/xpi_monitor/erts-15.2.7.4/bin/erlexec: /lib64/libc.so.6: version `GLIBC_2.34’ not found (required by /opt/xpi_monitor/erts-15.2.7.4/bin/erlexec)
If I recall correctly, this means you have compiled your app with an older version of the Linux (well, the glibc core library actually) compared to where the app has been copied to.
If you can make sure both your container and the target server have the same glibc version then you’ll be fine.
It’s the other way around. The release has been built against a newer version of glibc (2.34) than can be found on the target system (2.28).
Yes, this is a classic glibc mismatch. Your Elixir binary was built with glibc 2.34, but Oracle Linux 8.5 only has 2.28. That’s why /lib64/libc.so.6 is not working.
You can’t compile on the target server, so the easiest way to build is to use a Docker image that is the same as or newer than glibc 2.34. A lot of people get a Fedora, Ubuntu 22.04, or Debian Bullseye base image because they come with glibc 2.34+ already installed. Build your Elixir release there, and then send the binaries to Oracle Linux.
You could also try static linking for your release, but Elixir/Erlang doesn’t always work well with fully static builds. So, the best and least painful way to match glibc is to use a newer Docker build image.
2 Likes