M1 下的 docker 是能支持 x86 的镜像吧?

2021-02-03 14:51:07 +08:00
 idblife

这个疑问很强烈了

3737 次点击
所在节点    问与答
13 条回复
InternetExplorer
2021-02-03 14:55:19 +08:00
不支持的噢,亲
mxT52CRuqR6o5
2021-02-03 14:58:21 +08:00
不是说靠 qemu 支持德玛,不过我没用过也不清楚
即使支持效率肯定很低就是了
idblife
2021-02-03 14:59:47 +08:00
@InternetExplorer
目前 docker 还没正式适配 m1,是说从技术上来讲,正式适配后也无法支持 x86 镜像吗?
baiyi
2021-02-03 15:00:04 +08:00
我还以为 docker 说的适配就是指的这个,搜了一下,原来是说 Docker Desktop 的适配
boris93
2021-02-03 15:00:13 +08:00
@mxT52CRuqR6o5 #2 我试过在 x86 服务器用 qemu 跑 aarch64,巨慢
idblife
2021-02-03 15:03:14 +08:00
@boris93
但是还是能跑起来吧?
本机倒是不要求快,能 docker build 就行啊
idblife
2021-02-03 15:15:15 +08:00
@InternetExplorer
看了下官方博客,是 ok 的

Multi-Platform Baked In

Many developers are going to experience multi-platform development for the first time with the M1 Macs. This is one of the key areas where Docker shines. Docker has had support for multi-platform images for a long time, meaning that you can build and run both x86 and ARM images on Desktop today. The new Docker Desktop on M1 is no exception; you can build and run images for both x86 and Arm architectures without having to set up a complex cross-compilation development environment.
boris93
2021-02-03 15:42:51 +08:00
@idblife 如果 Docker 平台支持 M1,那至少跑起来应该可以
nutting
2021-02-03 15:45:55 +08:00
我装了支持 m1 的预览版,重启一次后就挂了,提示是否恢复初始设置,点了就卡死
liprais
2021-02-03 15:47:39 +08:00
docker 在 Mac 上用的虚拟机
vm 不是模拟器
idblife
2021-02-03 16:52:48 +08:00
@nutting
我去,一盆凉水...
idblife
2021-02-03 16:53:04 +08:00
@liprais
没明白啥意思呢
jybox
2021-02-03 17:58:41 +08:00
是支持的:

M1 芯片之前对我来说最大的变数在于对 Docker 的支持,但就在前几天 Docker for Mac 也发布了 针对 M1 芯片的测试版本。测试版中默认会运行一个 ARM 架构的 Linux 虚拟机,默认运行 linux/arm64 架构的镜像(说起来在 M1 之前 linux/arm64 大概主要是被用在树莓派上吧);对于没有提供 linux/arm64 架构的镜像则会自动使用 QEMU 来运行 x64_64 的镜像,性能就比较差了。

而使用 Docker for Mac 构建镜像则没有提升,这可能是因为构建的过程有很多零散的 IO,CPU 会有比较多的时间休息。而如果使用 Docker 去构建 x86_64 架构的镜像的话,性能损失就非常严重了(-61%)。

针对 M1 芯片的测试版本 https://docs.docker.com/docker-for-mac/apple-m1/
完整测评文章 https://jysperm.me/2021/01/macbook-air-apple-silicon/

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/750935

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX