Got a very strange issue with my build, I have a Dockerfile that builds and runs fine on my local machine (Mac M1 16Gb). I try and deploy with flyctl --app morning-field-8704 deploy .
See errors below (different but no config change, just tried again)
My question, how can the behaviour differ between my local machine and what Fly is doing?
(I have previously deployed this app and saw similar errors which got solved by upgrading the memory)
Help greatly appreciated.
Tom
=> [build 7/11] RUN mix do deps.get, deps.compile 36.7s
=> => # qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Then I tried again and got #15 5.272 could not compile dependency :earmark_parser, “mix compile” failed. You can recompile this dependency with “mix deps.compile earmark_parser”, update it with “mix deps.update earmark_parser” or clean it with “mix deps.clean earmark_parser”
Well that’s good. I’m guessing there’s an issue building that x86 image on an m1 CPU. This could either be a bug in flyctl or a bug in Docker cross platform building. Assuming the --remote-only works, will you try building an x86 image with Docker directly and see if you get the same segfault?
Docker runs x86 images with qemu emulation which doesn’t always work on the M1. That segfault is somewhat of a known issue, but with the images being ran rather than Docker or flyctl. The best options are building with a docker daemon running on x86 system, like our remote builders or another docker host you manage.
It’s often intermittent, so maybe building with docker might help: docker build --platform linux/amd64
We’re contemplating doing remote builds by default on M1 Macs until these issues are fixed.