pythondockerqemu

How do I run a multiarch Docker image for a foreign architecture?


With the new multiarch Docker infrastructure, you can run, say, python:3.6 and it will automatically choose the right image you based on the host architecture. Now, how can I override this and run a variant of the image built for another architecture, assuming that I have the appropriate qemu and binfmt support in place?


Solution

  • I'm not sure if this is consistent across all images, but for official images all it takes is prefixing an image name with the architecture:

    docker run s390x/python:3.7-alpine3.8 python --version
    docker run arm64v8/alpine uname -a
    

    You can check the above repo for supported architectures for each release.