[Solved] The requested image’s platform (linux/arm64/v8) does not match the detected host platform (linux/amd64) and no specific platform was requested.
A Quick and easy fix for running Docker images on your new Apple M1 chip.
Following the recent purchase of a Macbook Air (A2337), I could no longer run my Docker images even they had been successfully compiled in VSCode.
The error encountered was “the requested image’s platform (linux/arm64/v8) does not match the detected host platform (linux/amd64) and no specific platform was requested.” It was reported that the exec user process caused “exec format error.”
Below is the solution that has sorted out the issue for me.
I’m assuming you have already generated all the related Docker files, i.e., Dockerfile, .dockerignore, docker-compose.yml (optional), and docker-compose.debug.yml (optional) when you run into this error.
In your Dockerfile, simply add
--platform=linux/amd64 before specifying your application platform.
FROM --platform=linux/amd64 (your-application-platform)
FROM --platform=linux/amd64 node:lts-alpine
There you go, everything should be up and running as usual.