Got error while you build docker image using Apple M1 ?

locvfx

Dylan Lopez

Posted on August 31, 2023

Got error while you build docker image using Apple M1 ?

WARNING: The requested image’s platform (linux/amd64) does not match the detected host platform (linux/arm64/v8)

This warning message indicates that there is a platform mismatch between the requested image and the host platform. The requested image was likely built for the Linux/amd64 platform, but the host platform where the image is being executed is Linux/arm64/v8.

This can cause compatibility issues and may result in errors or unexpected behavior. To resolve this issue, you may need to obtain a version of the image that is compatible with the host platform, or update the host platform to match the platform for which the image was built. But before that, let us understand the problem statement more deeply.

Here is the quick fix: Under the “Feature in development section”, enable Rosetta.
Image description

Run x86 containers with Rosetta
If you want to build and run x86 container images using Rosetta, use the platform flag as in the following commands:

example:

docker build --platform linux/amd64 -t nginx:latest .
docker run --platform linux/amd64 nginx:latest

💖 💪 🙅 🚩
locvfx
Dylan Lopez

Posted on August 31, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related