jschaeff
Release and NIF library
Hello !
Mix release with NIF in a containser crashes … I can’t find why.
If I run the project locally (mix phx.serve) it works.
When I build a release locally and run it, it works.
When I copy the locally generated release directory in a Docker container and spin it up, it works.
When I build everything in a Docker container (mix release), it fails with the following error:
=INFO REPORT==== 13-May-2026::10:16:55.060537 ===
application: kernel
exited: {{shutdown,
{failed_to_start_child,on_load,
{on_load_function_failed,'Elixir.MSeed.NIF',
{error,
{bad_lib,
"Failed to find library init function: '/app/wsdataselect/lib/wsdataselect-1.1.18/priv/libexmseed.so: undefined symbol: _nif_init'"}}}}},
{kernel,start,[normal,[]]}}
type: permanent
Kernel pid terminated (application_controller) ("{application_start_failure,kernel,{{shutdown,{failed_to_start_child,on_load,{on_load_function_failed,'Elixir.MSeed.NIF',{error,{bad_lib,\"Failed to find library init function: '/app/wsdataselect/lib/wsdataselect-1.1.18/priv/libexmseed.so: undefined symbol: _nif_init'\"}}}}},{kernel,start,[normal,[]]}}}")
ldd on the /app/wsdataselect/lib/wsdataselect-1.1.18/priv/libexmseed.so says everything is statically linked.
Dockerfile Dockerfile · 65-libmseed-nif · OSUG / RESIF / wsdataselect · GitLab
Anybody has an idea what is missing in the container ?
Marked As Solved
jschaeff
By iterating over a naive Dockerfile until the release breaks, I identified the missing part in the docker context (I omitted to put the ./c directory). Weirdly, the compilation worked, but the release missed all the NIF part.
The fix: Add missing directory in build context (afa04fb3) · Commits · OSUG / RESIF / wsdataselect · GitLab
Thanks for the replies !
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









