pedromvieira
Distillery & Docker: How to correct setup release without ERTS and load docker image with Erlang only?
I’m following this excelent post to use Distillery & Docker without including ERTS.
My final docker app is failing to start with “init terminating in do_boot (cannot expand $ERTS_LIB_DIR in bootfile)”
Any extra considerations beyond the article? What is your build process? My ideia is to use Kubernetes also with multiple nodes.
Marked As Solved
pedromvieira
I forgot to add some parameters (server, root and version) listed in “Configuring your Release” at:
https://hexdocs.pm/distillery/use-with-phoenix.html#content
My final prod.exs:
config :myapp, MyAppWeb.Endpoint,
load_from_system_env: true,
url: [host: "myapp.io", port: 4000],
cache_static_manifest: "priv/static/cache_manifest.json",
server: true,
root: ".",
version: Application.spec(:myapp, :vsn)
Also had to change some libraries config to work with priv folder. (tzdata, ua_inspector and phone_number)
@jswny in my case I need to allow write permissions, so I changed dockerfile.run to do so.
# Set user
USER root
It only works with erts included.
If I try to execute a builded version without erts.
./docker_run.sh
{"init terminating in do_boot",{load_failed,[gen,gen_event,erl_lint,ets,lists,erl_parse,proc_lib,gen_server,erl_eval,supervisor,filename]}}
init terminating in do_boot ({load_failed,[gen,gen_event,erl_lint,ets,lists,erl_parse,proc_lib,gen_server,erl_eval,supervisor,filename]})
Crash dump is being written to: erl_crash.dump...done
Also Liked
jswny
Usually you place those files in priv/ and then Distillery will package them up into your release. Then, in your code you can use priv_dir = Application.app_dir(:myapp, "priv").
sneako
“The system writes the crash dump in the current directory of the emulator or in the file pointed out by the environment variable (whatever that means on the current operating system) ERL_CRASH_DUMP. For a crash dump to be written, a writable file system must be mounted.”
From http://erlang.org/doc/apps/erts/crash_dump.html







