A previously working (on linux) dockerized project builds okay on my new M1 mac, but fails while running with this error:
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
I know this is due to a different architecture (mac is arm, linux machine was amd) but don't know how to change my project to work. How can I move forward?
My base image is mhart/alpine-node:16
, and I am running a Node JS (TypeScript) application.
What I have tried (and thus why this is not a duplicate) - having read many similar threads - but hasn't helped:
- building for amd/64 (linux/intel arch) which Mac should then virtualise, but this didn't change much.
- adding a command to the Dockerfile to update qemu
RUN apk add --update qemu-x86_64
- updating base alpine node image to the latest version
- enabled experimental features in docker desktop
- from docker desktop I can see images are emulated arm64 architecture. I removed the 'from arm64' platform specifier in my Dockerfile and similar platform override in the docker compose file, I can then build an app image which runs without that amd64 tag. However it then still gets the same issue and fails.
- trying with a plain node (node14) base image