I have a small web application here – Lexin Mobi (https://lexin.mobi, GitHub - cr0t/lexin: Swedish Dictionary App) – which I deploy via Docker images. There are a couple of scripts (and Dockerfiles) that help me do that. Basically, I run mix release when building a new image – the approach almost identical to the one from Phoenix documentation.
After yesterday’s release of Elixir, I tried to build it using it and the latest Erlang. The resulting image size surprised me: 127 MB vs. usual ~35 MB. At glance, it appears that the files inside the /app/erts-15.0/bin directory are unusually big (6 MB vs. kilobytes in the previous version).
The only thing I changed – versions of Elixir and Erlang – even Alpine’s base image version is the same.
I couldn’t find any related notes in Erlang/OTP’s changelog. Plus, the files seem to have almost the same content, so something is wrong with the file system… I copied erlc from both containers to see what’s the difference, and the one from erts-15.0 contains loads of space inside:
Erlang repo or perhaps downstream packager, depending who’s build you are consuming (asdf or/and kerl?). as a curiosity, this stuff is compiled from the sources:
A status update: the previously linked issue landed at the right place. It has been fixed in the Erlang/OTP codebase.
However, we will need to wait for the release of Erlang/OTP 27.0.1 – this fix will be included there.
Debrief: the root cause of the issue is the LDFLAGS option for compiler that sneaked in the place they didn’t want it to be in, and it makes the compiler pad binaries with zeros in some areas.