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>静态二进制中绑定挂载到任何跨架构封装包。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 以下原文转载于(https://docs.docker.com/docker-for-mac/)(想找中文版的最新...
    Veekend阅读 7,654评论 0 17
  • 有一点冲动也有一丝决绝的加入了无戒的365训练营。长久以来一直有想要每天写东西的念头,去年工作的原因记了一年的流水...
    梦回千城阅读 312评论 1 1