sergio-ocon
Arm64 Dockerfile failing: ERROR [builder 6/17] RUN mix deps.get --only prod
Hi,
I am trying to build a multiple architecture image using Docker build.
> docker build -t chargio/liveview_counter --push --platform linux/arm64 .
I get an error (139) running this
> [+] Building 7.3s (16/28) docker:desktop-linux
> => [internal] load .dockerignore 0.0s
> => => transferring context: 1.35kB 0.0s
> => [internal] load build definition from Dockerfile 0.0s
> => => transferring dockerfile: 2.54kB 0.0s
> => [internal] load metadata for docker.io/library/debian:bookworm-20230612-slim 0.9s
> => [internal] load metadata for docker.io/hexpm/elixir:1.15.3-erlang-26.0.2-debian-bookworm-20230612-slim 1.0s
> => [builder 1/17] FROM docker.io/hexpm/elixir:1.15.3-erlang-26.0.2-debian-bookworm-20230612-slim@sha256:9fdcffc63a03bf77bf437510634ee7ad182135fc246283986c58fd8686c89326 0.0s
> => => resolve docker.io/hexpm/elixir:1.15.3-erlang-26.0.2-debian-bookworm-20230612-slim@sha256:9fdcffc63a03bf77bf437510634ee7ad182135fc246283986c58fd8686c89326 0.0s
> => [internal] load build context 0.1s
> => => transferring context: 73.36kB 0.1s
> => [deploy 1/6] FROM docker.io/library/debian:bookworm-20230612-slim@sha256:d8f9d38c21495b04d1cca99805fbb383856e19794265684019bf193c3b7d67f9 0.0s
> => => resolve docker.io/library/debian:bookworm-20230612-slim@sha256:d8f9d38c21495b04d1cca99805fbb383856e19794265684019bf193c3b7d67f9 0.0s
> => CACHED [deploy 2/6] RUN apt-get update -y && apt-get install -y libstdc++6 openssl libncurses5 locales && apt-get clean && rm -f /var/lib/apt/lists/*_* 0.0s
> => CACHED [deploy 3/6] RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen 0.0s
> => CACHED [deploy 4/6] WORKDIR /app 0.0s
> => CACHED [deploy 5/6] RUN chown nobody /app 0.0s
> => CACHED [builder 2/17] RUN apt-get update -y && apt-get install -y build-essential git && apt-get clean && rm -f /var/lib/apt/lists/*_* 0.0s
> => CACHED [builder 3/17] WORKDIR /app 0.0s
> => CACHED [builder 4/17] RUN mix local.hex --force && mix local.rebar --force 0.0s
> => CACHED [builder 5/17] COPY mix.exs mix.lock ./ 0.0s
> => ERROR [builder 6/17] RUN mix deps.get --only prod 6.1s
> ------
> > [builder 6/17] RUN mix deps.get --only prod:
> 6.023 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
> 6.036 Segmentation fault
> ------
> Dockerfile:39
> --------------------
> 37 | # install mix dependencies
> 38 | COPY mix.exs mix.lock ./
> 39 | >>> RUN mix deps.get --only $MIX_ENV
> 40 | RUN mkdir config
> 41 |
> --------------------
> ERROR: failed to solve: process "/bin/sh -c mix deps.get --only $MIX_ENV" did not complete successfully: exit code: 139
Blockquote
The same works great when using amd64.
I am using the Dockerfile generated by mix release --docker. And I’ve changed the debian version several times to use ‘bullseye’ - the default, ‘buster’, and ‘bookworm’, with the same result.
Do you know if there is some problem with the arm64 version of the image?
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
Using Phoenix.LiveView.TagEngine as an EEx.Engine is deprecated!
To compile HEEx, use Phoenix.LiveView.TagEngine.compile/2 instead.
Sta...
New
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app?
Looking for hints regarding:
Addi...
New
Hi all, I wanted to ask how the community is dealing with post-release steps.
Today we have Ecto migrations, which make sure that the db...
New
I am using Oban and occasionally, shortly after a deployment, a handful of jobs can fail because of dependency on other parts of the syst...
New
Other Trending Topics
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
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
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
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #performance










First 10 of 14 Posts
dimitarvp
Can you show us which exact container you’re using as a base?
sergio-ocon
I get the same error in the build phase using different docker images (as found here: https://hub.docker.com/r/hexpm/elixir/tags?page=1&name=debian-bookworm)
I’ve basically tried the non-slim version and it gets the same error, and I’ve found some similar errors with people trying to do the opposite (running amd64 containers in arm64 computers). I am using qemu 8.0.3 installed using brew.
The dockerfile:
(the version has rotated between different versions of Debian + slim)
The application runs perfectly in x86_64. You can find the code here:
https://github.com/chargio/container_liveview_counter
And the description of it here:
https://medium.com/@chargio/how-to-easily-run-your-elixir-application-in-a-local-kubernetes-using-docker-desktop-f0c1ccfd49e6
dimitarvp
I scanned your linked blog post and noticed this:
When the image really should begin with
hexpm/elixir-arm64and not withhexpm/elixir.Just a blind shot though, assuming you haven’t tried it.
sergio-ocon
Tried changing from Docker Desktop to Rancher Desktop with the same result when using QEMU and the Apple Virtualization framework (VZ), experimental.
sergio-ocon
The blog post is using amd64 as it is being deployed in a cluster in the cloud so it is ok.
Now I am trying to deploy the image in a raspberry pi (the cloud cluster is no longer active), and make the app multi-container, and I need to build the image for arm64 to make it run there. Unfortunately, it is not working. I am trying to understand if the problem is the image itself or qemu, because I no longer have an M1 machine to compile it for arm64.
[Corrected - it was amd64, not arm64]
dimitarvp
Not sure I get this, if the
FROMDockerfile clause is not pointing at the right arch how can it be okay?sergio-ocon
My mistake, the blogpost was written first time on an M1, but compiled by a friend and updated on an x86_64 Linux machine, then the second one on an X86_64 Mac as I no longer have the M1. Now I am trying to build the ARM version on the X86_64 machine to run it on K3s on a Raspberry Pi 4B, and it is failing.
I will try to do it tomorrow inside the Raspberry, even if it takes forever, and see if it works as expected.
pdgonzalez872
hi @sergio-ocon can you please add these vars to your setup? Mix deps.get memory explosion when doing cross-platform Docker build - #2 by pdgonzalez872
dimitarvp
I feel we’re talking past each other here.
Can you just try replacing this:
with this:
?
This should help you build it on any host, no?
cschmatzler
Add
ENV ERL_FLAGS="+JPperf true"to your Dockerfile.