pedromvieira

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

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

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

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

Where Next?

Popular in Questions Top

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
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
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
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
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
tduccuong
Hi, is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
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
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New

Other popular topics Top

josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
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
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
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
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 42633 214
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New

We're in Beta

About us Mission Statement