How to create a release that boots directly rom .ez archives

Hey there,

I’m looking for guides on how to create releases that packages as many as possible of the .beam files into .ez archives (optimally not just one .ez per app, but all apps in one .ez) - and boots from them without first extracting them.

So far with trial and error I’ve not been able to create a bootable release. Instead the system fails trying to load modules during boot and aborts. Similar to the errors here: Docker image for Erlang VM with minimal memory/disk usage - #9 by zabrane

({load_failed,[lists,logger_config,logger_filters,logger,kernel,heart,file_io_server,file_server,file,error_logger,erl_parse,erl_lint,erl_eval,code,proc_lib,code_server,application_master,application,error_handler,logger_simple_h,logger_server,gen_server,gen_event,gen,filename,ets,logger_backend,supervisor,application_controller]})

A working example would be amazing, but also a better understanding of the limits here, or hints how to debug this better.

E.g.

  • It seems a lot of the .ez handling is tied to escript usage of it - and not for normal releases. So maybe this is not even possible?
  • It’s unclear from the documentation and code if it’s even possible to put multiple applications .beam files into an .ez archive, but from looking at the code it looks like it should be possible?
  • For a release is it possible to put the earliest .beam files (the kernel app) into an .ez archive and still boot?
  • Any debug options to trace what is happening here before the failure, e.g. is the .ez archive even scanned, or does it fail parsing the zip?
  • If someone has experience here or a github link to working examples that would be amazing.

Cheers!

1 Like

This is a feature I wanted to add to rebar3/relx but never got around too. Maybe I will now that I have some time on my hands sort of.. It is supported by reltool so will be needed for relx/rebar3 OTP integration I think.

2 Likes

Not that ez archives might be slower and there’s discussion around potentially removing them: Proposed changes to the Erlang archives - are you using them?