wwaldner
I am trying to include Ortex in a docker container I am building. First started with Alpine container, and that is a no go. Alpine is going to be problematic because of the musl compiler…
Compiling lib/ortex/native.ex (it's taking more than 10s)
41.10 Compiling ureq v2.9.6
41.61 Compiling ort-sys v2.0.0-rc.8
41.98 error: failed to run custom build command for `ort-sys v2.0.0-rc.8`
41.98
41.98 Caused by:
41.98 process didn't exit successfully: `/app/_build/prod/lib/ortex/native/ortex/release/build/ort-sys-d7347b282fba238c/build-script-build` (exit status: 101)
41.98 --- stdout
41.98 cargo:rerun-if-env-changed=LIBONNXRUNTIME_NO_PKG_CONFIG
41.98 cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-alpine-linux-musl
41.98 cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_alpine_linux_musl
41.98 cargo:rerun-if-env-changed=HOST_PKG_CONFIG
41.98 cargo:rerun-if-env-changed=PKG_CONFIG
41.98 cargo:rerun-if-env-changed=LIBONNXRUNTIME_STATIC
41.98 cargo:rerun-if-env-changed=LIBONNXRUNTIME_DYNAMIC
41.98 cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
41.98 cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
41.98 cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-alpine-linux-musl
41.98 cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_alpine_linux_musl
41.98 cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
41.98 cargo:rerun-if-env-changed=PKG_CONFIG_PATH
41.98 cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-alpine-linux-musl
41.98 cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_alpine_linux_musl
41.98 cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
41.98 cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
41.98 cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-alpine-linux-musl
41.98 cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_alpine_linux_musl
41.98 cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
41.98 cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
41.98 onnxruntime not found using pkg-config, falling back to manual setup.
41.98 cargo:rerun-if-env-changed=ORT_LIB_LOCATION
41.98 cargo:rerun-if-env-changed=ORT_LIB_PROFILE
41.98 cargo:rerun-if-env-changed=ORT_PREFER_DYNAMIC_LINK
41.98 selected feature set: none
41.98
41.98 --- stderr
41.98 thread 'main' panicked at /app/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ort-sys-2.0.0-rc.8/build.rs:360:17:
41.98 downloaded binaries not available for target x86_64-alpine-linux-musl
41.98 you may have to compile ONNX Runtime from source
41.98 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
41.98 warning: build failed, waiting for other jobs to finish...
42.31
42.31 == Compilation error in file lib/ortex/native.ex ==
42.31 ** (RuntimeError) Rust NIF compile error (rustc exit code 101)
42.31 (rustler 0.35.1) lib/rustler/compiler.ex:36: Rustler.Compiler.compile_crate/3
42.31 lib/ortex/native.ex:11: (module)
42.31 could not compile dependency :ortex, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile ortex --force", update it with "mix deps.update ortex" or clean it with "mix deps.clean ortex"
However, when I tried in a Debian container, I did not get much further…
.49 Compiling 6 files (.ex)
34.56 Generated rustler app
34.57 ==> ortex
34.57 Compiling 6 files (.ex)
34.60
34.60 == Compilation error in file lib/ortex/native.ex ==
34.60 ** (ErlangError) Erlang error: :enoent
34.60 (elixir 1.15.8) lib/system.ex:1111: System.cmd("cargo", ["metadata", "--format-version=1"], [cd: "native/ortex"])
34.60 (rustler 0.35.1) lib/rustler/compiler/config.ex:76: Rustler.Compiler.Config.metadata!/1
34.60 (rustler 0.35.1) lib/rustler/compiler/config.ex:63: Rustler.Compiler.Config.build/1
34.60 (rustler 0.35.1) lib/rustler/compiler.ex:8: Rustler.Compiler.compile_crate/3
34.60 lib/ortex/native.ex:11: (module)
34.60 could not compile dependency :ortex, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile ortex --force", update it with "mix deps.update ortex" or clean it with "mix deps.clean ortex"
------
debian.Dockerfile:226
--------------------
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
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
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
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
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
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Just published claude-code-elixir, a plugin marketplace for Claude Code with Elixir support. These are the plugins I’ve been using for my...
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
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
D4no0
Have you installed rust in the debian container? The error says that command
cargowas not found.dimitarvp
:enoentis a basic “file not found” error. You should install Rust in the container.wwaldner
Yes, it was not clear to me that the error was indicating that cargo was not installed. That is the issue. I did have rust installed, but it was not in the PATH. Now I have it in the path and but get the following error
dimitarvp
Here are the two lines in my
Dockerfiles that make Rust work just fine:(Obviously make sure the
targetis the right one i.e. there are plenty of ARM containers out there.)The key is to not only install Rust via rustup but also “activate” a toolchain – in this case
stable– which is very akin to how version managers likeasdf/misework: you (1) install a tool and (2) make a version active / default.In the example above the
--default-toolchain stabledoes that, or you can do it manually like so (put this in yourDockerfileafter installing rustup and Rust through it):wwaldner
Thanks for looking at this. It just does not want to work.
I have tried to set the toolchain version explictly and also with the cmd you provided, same result.
wwaldner
Apparently this has to do with multi-stage docker build. If I install Rust in prior stage, it fails. However, if I install Rust just before the
mix deps.compileit works ok.dimitarvp
Multi-stage Docker builds are super useful, what’s your difficulty? You can just base your next stage with the previous one and should be fine?
wwaldner
Right, that is what I am thinking. Here is what I had to do to make it work. In the second stage, the ENV HOME… is messing up cargo
D4no0
The way you want to usually separate the docker stages is that the first stage compiles and creates a release, and the second one is a clear linux container + runtime dependencies required when you are running the elixir release.
What you are currently doing doesn’t make much sense and I am amazed it works at all.
wwaldner
First stage is basic OS stuff without any app data, second stage copies app and compiles mix. There are subsequent stages that create a clean container with just the app + runtime deps