Leveraging multi-CPU architecture support

利用多CPU架构支持

Docker for Mac provides binfmt_misc multi architecture support, so you can run containers for different Linux architectures, such as arm, mips, ppc64le and even s390x.

Docker for Mac提供<code>binfmt_misc</code>多架构支持,所以,你可以在不同的Linux架构上,例如<code>arm</code>,<code>mips</code>,<code>ppc64le</code>和<code>s390x</code>运行容器container

This should just work without any configuration, but the containers you run need to have the appropriate qemu
binary inside the container before you can do this. (See QEMU for more information.)

这不需要您作任何设置就可运行,但在这之前,你运行的容器里需要兼容<code>qemu</code>二进制

So, you can run a container that already has this set up, like the resin arm builds:

所以,你可以运行早已配置好这个的容器,例如<code>resin</code>arm builds

<pre>
$ docker run resin/armv7hf-debian uname -a
Linux 7ed2fca7a3f0 4.1.12 #1 SMP Tue Jan 12 10:51:00 UTC 2016 armv7l GNU/Linux
$ docker run justincormack/ppc64le-debian uname -a
Linux edd13885f316 4.1.12 #1 SMP Tue Jan 12 10:51:00 UTC 2016 ppc64le GNU/Linux
</pre>

Running containers pre-configured with qemu has the advantage that you can use these to do builds FROM, so you can build new Multi-CPU architecture packages.

运行预配置好<code>qemu</code>的好处是你可以使用它来编译FROM,所以你可以编译新的多CPU封装包

Alternatively, you can bind mount in the qemu static binaries to any cross-architecture package, such as the semi-official ones using a script like this one https://github.com/justincormack/cross-docker. (See the README at the given link for details on how to use the script.)

或者,你可以在<code>qemu</code>静态二进制中绑定挂载到任何跨架构封装包。

推荐阅读更多精彩内容