# Segfault for docker image on non native platform

**URL:** <https://erlangforums.com/t/segfault-for-docker-image-on-non-native-platform/1871>\
**Category:** Questions / Help\
**Tags:** erlang, docker\
**Created:** [September 27, 2022, 9:33am UTC](https://erlangforums.com/t/segfault-for-docker-image-on-non-native-platform/1871 "2022-09-27T09:33:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kpy3](https://erlangforums.com/user_avatar/erlangforums.com/kpy3/32/238_2.png) [@kpy3](https://erlangforums.com/u/kpy3)\
**Post date:** [September 27, 2022, 9:33am UTC](https://erlangforums.com/t/segfault-for-docker-image-on-non-native-platform/1871/1 "2022-09-27T09:33:31Z")

</div>

Hello there,

we have a lot of docker images for various microservices built for linux/amd64, which build on top of official docker erlang images (24.x and 25.x). I tried to run some of them on Apple M1 MacBook Pro, but all crashed with segfault. I’ve found that the problem in docker image itself:

```erlang
% docker run --platform linux/amd64 -ti erlang:25.1
Unable to find image 'erlang:25.1' locally
25.1: Pulling from library/erlang
Digest: sha256:f9ee7e6df6c65a633a1b5e8691ec8787021d57f16a598025a84c05c43e558641
Status: Downloaded newer image for erlang:25.1
qemu: uncaught target signal 11 (Segmentation fault) - core dumped

```

I guess the problem in JIT, because earlier release images works just fine:

```erlang
% docker run --platform linux/amd64 -ti erlang:23 [XP-627-ci]
Erlang/OTP 23 [erts-11.2.2.16] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]

Eshell V11.2.2.16 (abort with ^G)
1>

```

So is there any ways to run images built on top of latest Erlang without recompiling them from scratch?

---

<div class="post-metadata">

**Author:** ![mworrell](https://erlangforums.com/user_avatar/erlangforums.com/mworrell/32/267_2.png) [@mworrell](https://erlangforums.com/u/mworrell)\
**Post date:** [September 27, 2022, 10:33am UTC](https://erlangforums.com/t/segfault-for-docker-image-on-non-native-platform/1871/2 "2022-09-27T10:33:50Z")

</div>

x86 Docker images can be considered non-functional on the new macOS machines. We saw the same with Elastic Search images. You have to use an ARM image on the M1/M2 machines.

---

<div class="post-metadata">

**Author:** ![LostKobrakai](https://erlangforums.com/user_avatar/erlangforums.com/lostkobrakai/32/453_2.png) [@LostKobrakai](https://erlangforums.com/u/LostKobrakai)\
**Post date:** [September 27, 2022, 2:16pm UTC](https://erlangforums.com/t/segfault-for-docker-image-on-non-native-platform/1871/3 "2022-09-27T14:16:37Z")

</div>

Iirc docker just blames qemu for anything not working with x86 on arm.

---

<div class="post-metadata">

**Author:** ![pdgonzalez872](https://erlangforums.com/user_avatar/erlangforums.com/pdgonzalez872/32/1348_2.png) [@pdgonzalez872](https://erlangforums.com/u/pdgonzalez872)\
**Post date:** [September 27, 2022, 3:07pm UTC](https://erlangforums.com/t/segfault-for-docker-image-on-non-native-platform/1871/4 "2022-09-27T15:07:07Z")

</div>

hi @kpy3 ! You should be able to build the image on the M1 and then use that image (and share it) later on. As far as I know, that’s a vendor problem (`qemu` in this case). I came across this problem a little while ago and this was the ultimate takeaway.

[[arm64+otp 25+qemu] `mix local.hex --force` hangs - #4 by pdgonzalez872 - Questions / Help - Elixir Programming Language Forum](https://elixirforum.com/t/arm64-otp-25-qemu-mix-local-hex-force-hangs/48664/4).

---

<div class="post-metadata">

**Author:** ![kpy3](https://erlangforums.com/user_avatar/erlangforums.com/kpy3/32/238_2.png) [@kpy3](https://erlangforums.com/u/kpy3)\
**Post date:** [September 27, 2022, 3:22pm UTC](https://erlangforums.com/t/segfault-for-docker-image-on-non-native-platform/1871/5 "2022-09-27T15:22:24Z")

</div>

Yes, I’ve already rebuilt couple of them, but we had 10x of it, and I hoped to have not-so-long-and-expensive solution for the problem. 😅
