I have a multi stage docker file and building the node assets works fine with both --platform linux/arm64 and linux/amd64. I can make the elixir/erlang image work with --platform linux/arm64, but when I try linux/amd64 qemu blows up:
FROM --platform=linux/amd64 hexpm/elixir:1.12.3-erlang-24.1.5-ubuntu-focal-20210325 AS deps
RUN /usr/local/bin/mix local.hex --force && \
/usr/local/bin/mix local.rebar --force
RUN apt-get -qq update && apt-get install -y \
COPY config/ ./config
COPY mix.exs mix.lock /opt/app/
RUN mix deps.get --only $MIX_ENV
#12 [2/6] RUN /usr/local/bin/mix local.hex --force && /usr/local/bin/mix local.rebar --force
#12 1.540 qemu: uncaught target signal 11 (Segmentation fault) - core dumped
#12 1.546 Segmentation fault
#12 ERROR: executor failed running [/bin/sh -c /usr/local/bin/mix local.hex --force && /usr/local/bin/mix local.rebar --force]: exit code: 139
Anyone else getting this problem? Or found a way around it?
Thanks for reading!
The hexpm 1.13.0-rc.1 image uploaded yesterday actually works!!
It seems the images with erlang 24.1 blow up
Some more digging here. It’s not OTP24 that fails, it is OTP24 on some distros:
OTP24 on Ubuntu Focal FAILS (
OTP24 on Ubuntu Bionic FAILS (
OTP24 on Ubuntu Xenial WORKS (
OTP24 on Debian Stretch WORKS (
OTP24 on Debian Bullseye FAILS (
OTP24 on Alpine 3.14.2 FAILS (
The crash happens when JIT is enabled. Disabling the JIT, using pre-JIT Erlang (23.x or older), or using an old OS that doesn’t have a version of gcc recent enough to support C++17 (required to compile the JIT) will work around it.
Aha! Thank you for clearing this up. Is this something that will never work due to compatibility issues you think, or is it possible, but a bug with qemu?
I wish I knew! I also have that problem and I don’t know how to debug it
Is there any permanent solution to this?
I raised an issue on the docker for mac github, but it was closed and deferred to qemu.
There is a new qemu version out, but it hasn’t been picked up by docker yet (afaict)
It’s been handled poorly. Hopefully this time the issue might stay open so at least we learn where the culprit is or how to work around it Yet Another QEMU Segmentation Fault Issue · Issue #6261 · docker/for-mac · GitHub
I’ve had the same issue today and trying with the Ubuntu image of Elixir 1.13 and OTP 25 worked for arm64 using QEMU using Github Actions. (image name: