Join our Discord Server
Ajeet Raina Ajeet Singh Raina is a former Docker Captain, Community Leader and Arm Ambassador. He is a founder of Collabnix blogging site and has authored more than 570+ blogs on Docker, Kubernetes and Cloud-Native Technology. He runs a community Slack of 8900+ members and discord server close to 2200+ members. You can follow him on Twitter(@ajeetsraina).

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

2 min read

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.

Meet Rosetta 2…

 

Rosetta 2 is a dynamic binary translator designed by Apple for use on Mac computers with Apple Silicon processors. It allows these computers to run software that was originally designed for Macs with Intel processors, which used a different instruction set architecture (ISA) called x86.

Image1

How it works?

Rosetta 2 works by translating x86 instructions into ARM instructions, which are the ISA used by Apple Silicon processors. This translation happens in real-time as the software is running, which means that most applications can be used without any noticeable performance penalty.

Rosetta 2 is included with macOS Big Sur, which was released in November 2020. It runs automatically when you try to open an app that was built for x86 processors, and it usually works seamlessly in the background without any user intervention.

In addition to allowing Macs with Apple Silicon processors to run x86 applications, Rosetta 2 also includes some optimizations that can improve performance for certain types of software. For example, Rosetta 2 can use the neural engine in Apple Silicon processors to accelerate machine learning workloads.

Rosetta 2 is an important tool that allows Mac users to continue using their favorite software while transitioning to a new hardware platform. It demonstrates Apple’s commitment to providing a smooth and seamless user experience, even during major platform transitions.

How to run x86 containers on Apple Mac M1 Pro

There are a few workarounds you can use to run x86 containers on your Apple Silicon Mac. One option is to use a virtualization solution like Parallels Desktop or VMware Fusion to run a full-fledged virtual machine that can run x86 containers. Another option but the easiest one is to use a tool like Docker Desktop for Mac, which includes a built-in virtualization solution that allows you to run x86 containers on your Mac. Running x86 containers on Apple Silicon Macs just got easier thanks to newly added Docker’s Rosetta support.

Rosetta is for AMD64 binaries of Docker itself, QEMU is for running the containers. New Beta feature for MacOS 13, Rosetta for Linux, has been added for faster emulation of Intel-based images on Apple Silicon.

Pre-requisite:

  • Docker Desktop 4.16

  • Enable Rosetta 2 Virtualization feature in Docker Desktop

Go to the Settings > section and check the box to enable the Apple Virtualization framework.

Image2

Under the “Feature in development section”, enable Rosetta.

Image3

After changing these settings, the Docker Desktop app may restart before becoming available again.

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:

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

Using Docker Compose

Here’s an example of a Docker Compose file that specifies the platform as linux/amd64:

services:
  web:
    platform: linux/amd64
    image: nginx:latest
    ports:
      - "8080:80"

In this example, we have a single service called web that uses the nginx:latest image, which is built for the linux/amd64 platform. We’ve also specified that the service should be accessible on port 8080 on the host machine, which is mapped to port 80 inside the container.

Further Reading

  • Docker and Wasm Containers – Better Together

    Docker and Wasm Containers – Better Together

    Learn how Docker Desktop and CLI both manages Linux containers and Wasm containers side by side.

  • 6 Ways AI Improves Company Productivity

    6 Ways AI Improves Company Productivity

    Discover how Artificial Intelligence (AI) is transforming companies’ productivity through automation, communication enhancement, self-learning culture, role-expansion, and data-driven efficiency. Optimizing processes and maximizing resources with AI tools.

  • Deploying Ray on Kubernetes

    Deploying Ray on Kubernetes

    Ray is a framework for building and operating distributed applications that need performance, scalability, and fault tolerance. It offers an API for distributed computing and many libraries and tools for machine learning, reinforcement learning, hyperparameter tuning, and more. You can write code once and run it across machines, clusters, or clouds with Ray. Ray works…

  • How to Integrate Docker Scout with Microsoft Azure DevOps Pipeline

    How to Integrate Docker Scout with Microsoft Azure DevOps Pipeline

    Discover the powerful integration of Docker Scout and Azure DevOps Pipeline for automating Docker image building and security analysis efficiently. Ideal for developers, DevOps engineers, and security professionals.

Have Queries? Join https://launchpass.com/collabnix

Ajeet Raina Ajeet Singh Raina is a former Docker Captain, Community Leader and Arm Ambassador. He is a founder of Collabnix blogging site and has authored more than 570+ blogs on Docker, Kubernetes and Cloud-Native Technology. He runs a community Slack of 8900+ members and discord server close to 2200+ members. You can follow him on Twitter(@ajeetsraina).
Join our Discord Server
Index