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 · GitHub) – 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

sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
mgjohns61585
Could someone help me? I’m making my first elixir program, number guessing game. I can’t figure out how to convert the user’s guess from ...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call t...
New
yawaramin
In the Dialyzer docs ( dialyzer — OTP 29.0.2 (dialyzer 6.0.1) ), there is a way to turn off a specific warning for a function: -dialyzer...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31265 143
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52673 488
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement