cr0t

cr0t

Much bigger Docker image size with Elixir 1.17.0 and Erlang/OTP 27.0

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).

Here is a screenshot that summaries my findings:

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:

What could be wrong with this? Do you have any ideas where to look? Maybe there are some new default behavior in Erlang/OTP 27? Thanks!

Marked As Solved

cr0t

cr0t

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.

10
Post #6

Also Liked

fmn

fmn

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:

$ du -sh /opt/erlang/27.0/lib/erlang/erts-15.0/bin/*
43M	/opt/erlang/27.0/lib/erlang/erts-15.0/bin/beam.smp
120K	/opt/erlang/27.0/lib/erlang/erts-15.0/bin/ct_run
116K	/opt/erlang/27.0/lib/erlang/erts-15.0/bin/dialyzer
40K	/opt/erlang/27.0/lib/erlang/erts-15.0/bin/dyn_erl
208K	/opt/erlang/27.0/lib/erlang/erts-15.0/bin/epmd
4.0K	/opt/erlang/27.0/lib/erlang/erts-15.0/bin/erl
500K	/opt/erlang/27.0/lib/erlang/erts-15.0/bin/erlc
444K	/opt/erlang/27.0/lib/erlang/erts-15.0/bin/erl_call
68K	/opt/erlang/27.0/lib/erlang/erts-15.0/bin/erl_child_setup
172K	/opt/erlang/27.0/lib/erlang/erts-15.0/bin/erlexec
4.0K	/opt/erlang/27.0/lib/erlang/erts-15.0/bin/erl.src
124K	/opt/erlang/27.0/lib/erlang/erts-15.0/bin/escript
40K	/opt/erlang/27.0/lib/erlang/erts-15.0/bin/heart
184K	/opt/erlang/27.0/lib/erlang/erts-15.0/bin/inet_gethost
84K	/opt/erlang/27.0/lib/erlang/erts-15.0/bin/run_erl
4.0K	/opt/erlang/27.0/lib/erlang/erts-15.0/bin/start
4.0K	/opt/erlang/27.0/lib/erlang/erts-15.0/bin/start_erl.src
4.0K	/opt/erlang/27.0/lib/erlang/erts-15.0/bin/start.src
44K	/opt/erlang/27.0/lib/erlang/erts-15.0/bin/to_erl
116K	/opt/erlang/27.0/lib/erlang/erts-15.0/bin/typer
1012K	/opt/erlang/27.0/lib/erlang/erts-15.0/bin/yielding_c_fun

Where Next?

Popular in Questions Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
LegitStack
I’m hoping you guys can give me some general advice and perhaps code examples if you’re feeling up to it. I’m very interested in Elixir,...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

Other popular topics Top

chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30048 115
New
shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
AstonJ
You’re a programmer, so you don’t need spoon feeding with the conventional drivel about “this is an integer.” No. You need to know what’s...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New

We're in Beta

About us Mission Statement