Can't compile Elixir/Phoenix API in Docker build step

My Phoenix Docker projects targeting x86_64/amd64 are all building great on my M2 Mac once I add these lines to my Dockerfile right after ENV MIX_ENV="prod":

# Workaround QEMU JIT issue building AMD64 on ARM64
ENV ERL_FLAGS="+JPperf true"

I think this only disables JIT during the build process. When the release runs in production performance is not affected.

6 Likes