1

I was trying to setup Dockerfile for my application but this application also creates some Erlang scripts at runtime with Rebar3. The issue is when i execute rebar3 new escript <name> at runtime, it gives me following error:

<<"===> Rebar dependency inets could not be loaded for reason {"no such file or directory",\n
"inets.app"}\n">>

This is the current part of the Dockerfile (Elixir image is based on Erlang image):


FROM docker.io/elixir:1.14

# Prepare Mix
RUN mix local.hex --force
RUN mix local.rebar --force

# Copy Release
COPY --from=builder /app/_build/prod/rel/example /release/example

ENTRYPOINT [ "/release/example/bin/example" ]

I tried installing erlang-dev, erlang-inets etc... And they didn't work.

7stud
  • 46,922
  • 14
  • 101
  • 127
MePP
  • 11
  • 2
  • What's the second line of that error message? – legoscia May 16 '23 at 08:31
  • There are no other output. – MePP May 16 '23 at 14:03
  • 1
    @legoscia, You need to scroll all the way to the right to see the end of the error message. Edit: I edited the op's post, so that you can see the whole error message. – 7stud May 16 '23 at 15:12
  • A wild guess at what the problem might be: the release is built with `dev_mode` set to `true`, meaning that `/app/_build/prod/lib` contains symlinks instead of actual copies of the libraries. Try setting `dev_mode` to `false` - see examples on [this page](https://adoptingerlang.org/docs/production/releases/). – legoscia May 16 '23 at 16:53
  • @legoscia, This error is from rebar3 itself, not any app. View detailed issue here: https://github.com/erlang/rebar3/issues/2789 – MePP May 16 '23 at 17:42
  • Actually adding `inets` to app.src solved the issue but i have zero idea about how? – MePP May 16 '23 at 18:35
  • Does this answer your question? [How can I make sure distillery includes Erlang inets in the release?](https://stackoverflow.com/questions/55100363/how-can-i-make-sure-distillery-includes-erlang-inets-in-the-release) – Adam Millerchip May 18 '23 at 12:21
  • @AdamMillerchip no, somehow `erlang:open_port` and my application looks like related. I just need to use `rebar3` globally with capturing it is informations realtime. – MePP May 19 '23 at 16:24

0 Answers0