tomazzlender
Elixir docker image won't build for linux/arm64/v8 using Github Actions
I setup a sample project on Github to show you a concrete example of a problem I’m having.
When I use
- Github Actions
- to build a docker image of an Elixir project
- using Elixir 1.14.5
- on an architecture linux/arm64/v8
the build fails. The same happens if I use Elixir 1.14.0, but a different error.
You can see errors on the links above.
If I use the same Dockerfile on Mac M2 or Raspberry PI (aarm64 architecture), the build succeeds.
I’m not sure what could be the issue.
The build also succeeds
- if I use Github Actions but some other architecture.
- if I use Elixir 1.13.4
Any idea would be much appreciated
.
Marked As Solved
jhogberg
I’ll see if I can make a PR that fixes this in QEMU, it doesn’t seem to be a very high priority for them.
For the time being you can disable the JIT by compiling Erlang with ./configure --disable-jit.
Also Liked
yuriploc
Every time I forget about this I end up reading this post and also this one: BEAM docker release GitHub action - a GitHub action to build a docker container from a BEAM (Elixir/Erlang) release - #2 by asabil - Libraries - Erlang Programming Language Forum - Erlang Forums
TL;DR, adding ERL_FLAGS="+JPperf true" to your env vars should solve the issue with QEMU when building for linux/arm64 on a linux/amd64 host.
jhogberg
As a small update, the patch for user-mode emulated AArch64 has been accepted and will most likely make it into the next major version of QEMU.
x86-64 is not covered by the patch, and may take much longer to get in if it’s accepted at all, as the workaround might not be as palatable (invalidating all translated code everywhere on serializing instructions like cpuid).








