christo-ph
After generating a Dockerfile with mix release, and build it with docker build, I am unable to start elixir in the container:
=INFO REPORT==== 15-Dec-2023::08:20:17.080211 ===
application: kernel
exited: {{shutdown,
{failed_to_start_child,on_load,
{on_load_function_failed,gl,
{error,
{load_failed,
"Failed to load NIF library: '/app/lib/wx-2.3.1/priv/erl_gl.so: cannot open shared object file: No such file or directory'"}}}}},
{kernel,start,[normal,[]]}}
type: permanent
I am using the generated Dockerfile as is with the following versions:
ARG ELIXIR_VERSION=1.15.7
ARG OTP_VERSION=26.1.2
ARG DEBIAN_VERSION=bullseye-20231009-slim
ARG BUILDER_IMAGE="hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-debian-${DEBIAN_VERSION}"
ARG RUNNER_IMAGE="debian:${DEBIAN_VERSION}"
What is missing here? build and execution on Apple Silicon
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
christo-ph
So in my case, the issue was a dependency which uses
:wxand:observerremoved and the container runs as expected. Unfortunatelymix deps.treedoes not show such dependencies. To find the one I searched for:wxand:observerin the deps directory. Be aware that in VSCode this folder might be excluded from global search, so use grep or similar form the command line.D4no0
For future reference, these applications are part of OTP and are bundled together with erlang runtime, if declared of course.
In earlier versions of elixir, all packages would be usually bundled without having to specifically add them, this changed in version 1.15 (or maybe earlier), now you have to specifically declare them if you want to bundle them with your release.
On the dev side, the libraries will work without adding
extra_applicationsas long as your local erlang installation compiled all of them.christo-ph
With specifically add them you mean also add them to my-app
extra_applications?D4no0
The behavior you are encountering above might be subject to a potential bug, if either your app or a library has
extra_applicationsdefined, the OTP libraries should be bundled with release. I misread before, thinking that you are using those libraries from your own application.A simple example would be the fact that phoenix uses crypto, which is an OTP library, and you don’t have to declare it in your actual application.
rhblind
Hey,
I’ve been struggling with the exact same issue today, but the solution suggested doesn’t work and I don’t understand why. I can run the application locally just fine, but when built as a production build using
mix releaseit blows up with the following traceback.In my
mix.exsfile I have the following, so as far as I can tell it shouldn’t try to loadwxwhen running the build.The application is running in a docker image using:
Docker Image:
Erlang/OTP:
IEx 1.17.2 (compiled with Erlang/OTP 27)
Does anybody know what could be the reason?
Cheers!
harrisi
Are you setting
MIX_ENVanywhere? Does the docker container have erlang built with wx enabled?rhblind
I’m using the official
elixir:1.17-alpineimage as my build image. I don’t know if erlang was built with wx enabled or not.I’m also setting MIX_ENV inside my Dockerfile in the build step.
Here’s the Dockerfile for referenece.
I tried adding the
erlang-wxapk to test if that would solve anything, but it had no effect.harrisi
Your
mix.exsdoesn’t include:wxwhenMIX_ENVis notdev, with this line:defp extra_applications(_), do: [:logger, :runtime_tools, :os_mon]. If you want yourdevand other environments to use the same set ofextra_applications, you’d want to remove that clause and change the other clause to accept any argument. I’m not sure if theerlang-wxpackage forapkwould be needed.rhblind
Yeah, that’s the ting.. I really don’t want
:wxto start in production builds. That’s what so weird about this error. I was under the impression that since I don’t include it inextra_applications, it shouldn’t be loaded, but somehow it blows up anyway.Things I have tried:
:wxinextra_applicationsin a production buildBut all of them crash and burn with the same error.
rhblind
I haven’t tested yet, but I suspect I’ve found the offender. I have a dependency which is another mix project which loads
:wxand:observeras part of theirextra_applications. And I forgot to addruntime: falseto the dependency. Running new build with fingers crossed now!