Docker image with membrane_webrtc_plugin

Hi! I have some issues with running a Phoenix app in a Debian-based docker. Whereas it can be built, when I am running it, it crashes:
=CRASH REPORT==== 23-Apr-2025::21:25:12.868807 ===
crasher:
initial call: supervisor:kernel/1
pid: <0.3186.0>
registered_name: []
exception exit: {on_load_function_failed,
'Elixir.Membrane.VPx.Decoder.Native.Nif',abort}
in function init:run_on_load_handlers/0
in call from kernel:init/1 (kernel.erl, line 196)
in call from supervisor:init/1 (supervisor.erl, line 330)
in call from gen_server:init_it/2 (gen_server.erl, line 851)
in call from gen_server:init_it/6 (gen_server.erl, line 814)
ancestors: [kernel_sup,<0.3160.0>]
message_queue_len: 0
messages: []
links: [<0.3162.0>]
dictionary: []
trap_exit: true
status: running
heap_size: 376
stack_size: 28
reductions: 187
neighbours:
=CRASH REPORT==== 23-Apr-2025::21:25:12.868807 ===
crasher:
initial call: supervisor:kernel/1
pid: <0.3186.0>
registered_name: []
exception exit: {on_load_function_failed,
'Elixir.Membrane.VPx.Decoder.Native.Nif',abort}
in function init:run_on_load_handlers/0
in call from kernel:init/1 (kernel.erl, line 196)
in call from supervisor:init/1 (supervisor.erl, line 330)
in call from gen_server:init_it/2 (gen_server.erl, line 851)
in call from gen_server:init_it/6 (gen_server.erl, line 814)
ancestors: [kernel_sup,<0.3160.0>]
message_queue_len: 0
messages: []
links: [<0.3162.0>]
dictionary: []
trap_exit: true
status: running
heap_size: 376
stack_size: 28
reductions: 187
neighbours:
I am using Debian bullseye-20250407-slim and I am installing the following dependencies for the runner machine:
RUN apt-get update -y && \
apt-get install -y libstdc++6 openssl libncurses5 locales ca-certificates ffmpeg libvpx-dev libvpx6 \
&& apt-get clean && rm -f /var/lib/apt/lists/*_*
RUN apt-get update -y && \
apt-get install -y libstdc++6 openssl libncurses5 locales ca-certificates ffmpeg libvpx-dev libvpx6 \
&& apt-get clean && rm -f /var/lib/apt/lists/*_*
3 Replies
xmarvl
xmarvlOP•5d ago
I figured out some additional information. It has nothing to do with Docker. When I am running server with mix phx.server it works fine. It only crashes after it is built into a release (which is essentially what Docker does).
Kuba Rozruba
Kuba Rozruba•3d ago
Hi! It seems that there is some sort of problem with the native (written in C) part of VPx decoder. By default pluigins with native dependencies pull the precompiled builds of the dependencies. This behavior can be disabled in config and that's what I would suggest you do:
config :bundlex, :disable_precompiled_os_deps, apps: [:membrane_vpx_plugin]
config :bundlex, :disable_precompiled_os_deps, apps: [:membrane_vpx_plugin]
or if you don't want to fetch any precompiled dependencies:
config :bundlex, :disable_precompiled_os_deps, apps: true
config :bundlex, :disable_precompiled_os_deps, apps: true
This will ensure that a precompiled build of libvpx will not be fetched and the compiler will use the one you have installed locally.
xmarvl
xmarvlOP•2d ago
Hi! I tried this but I am still getting similar error, but with Elixir.Membrane.VPx.Encoder.Native.Nif. Basically, I added "apt-get install -y pkg-config libssl-dev libvpx-dev" to dependencies included in phoenix-generated Dockerfile. well, I can see that sometimes it is decoder and sometimes - encoder. I followed the first option, only disabling :membrane_vpx_plugin ok, now I see that I needed to add vpx-tools to the runner image. It is solved, but now the other component failed. I will try to eliminate them one by one 🙂

Did you find this page helpful?