V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
idblife
V2EX  ›  问与答

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

  •  
  •   idblife · 2021-02-03 14:51:07 +08:00 · 3716 次点击
    这是一个创建于 1150 天前的主题,其中的信息可能已经有所发展或是发生改变。

    这个疑问很强烈了

    13 条回复    2021-02-03 17:58:41 +08:00
    InternetExplorer
        1
    InternetExplorer  
       2021-02-03 14:55:19 +08:00 via iPhone
    不支持的噢,亲
    mxT52CRuqR6o5
        2
    mxT52CRuqR6o5  
       2021-02-03 14:58:21 +08:00
    不是说靠 qemu 支持德玛,不过我没用过也不清楚
    即使支持效率肯定很低就是了
    idblife
        3
    idblife  
    OP
       2021-02-03 14:59:47 +08:00
    @InternetExplorer
    目前 docker 还没正式适配 m1,是说从技术上来讲,正式适配后也无法支持 x86 镜像吗?
    baiyi
        4
    baiyi  
       2021-02-03 15:00:04 +08:00
    我还以为 docker 说的适配就是指的这个,搜了一下,原来是说 Docker Desktop 的适配
    boris93
        5
    boris93  
       2021-02-03 15:00:13 +08:00 via Android
    @mxT52CRuqR6o5 #2 我试过在 x86 服务器用 qemu 跑 aarch64,巨慢
    idblife
        6
    idblife  
    OP
       2021-02-03 15:03:14 +08:00
    @boris93
    但是还是能跑起来吧?
    本机倒是不要求快,能 docker build 就行啊
    idblife
        7
    idblife  
    OP
       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
        8
    boris93  
       2021-02-03 15:42:51 +08:00 via Android
    @idblife 如果 Docker 平台支持 M1,那至少跑起来应该可以
    nutting
        9
    nutting  
       2021-02-03 15:45:55 +08:00
    我装了支持 m1 的预览版,重启一次后就挂了,提示是否恢复初始设置,点了就卡死
    liprais
        10
    liprais  
       2021-02-03 15:47:39 +08:00
    docker 在 Mac 上用的虚拟机
    vm 不是模拟器
    idblife
        11
    idblife  
    OP
       2021-02-03 16:52:48 +08:00
    @nutting
    我去,一盆凉水...
    idblife
        12
    idblife  
    OP
       2021-02-03 16:53:04 +08:00
    @liprais
    没明白啥意思呢
    jybox
        13
    jybox  
       2021-02-03 17:58:41 +08:00   ❤️ 1
    是支持的:

    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/
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2749 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 12:35 · PVG 20:35 · LAX 05:35 · JFK 08:35
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.