M1 下的 docker 是能支持 x86 的镜像吧?
这个疑问很强烈了
这个疑问很强烈了
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.
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/