Oxcart 下载
菜单

Apple 芯片上的 Docker Compose:amd64 镜像、Rosetta 与健康检查

Docker Compose 可在 Apple 芯片 Mac 上原生运行:有 arm64 镜像时优先使用,没有时设置 platform: linux/amd64,并通过 up --wait 等待健康检查通过再完成启动。Oxcart 随附 Compose 5.6、docker CLI 和 Buildx,通过 Rosetta 运行 amd64 镜像,在我们测试的三款运行时中,构建和容器生命周期操作最快。

更新于

优先 arm64,必要时用 amd64

M 系列 Mac 在 arm64 Linux 内核上运行 Linux 容器。拉取多架构镜像(postgres、redis、node、python 及大多数官方镜像)时,Docker 会自动选择 arm64 版本,以原生速度运行。

有些镜像仍仅提供 amd64 版本:较旧的内部镜像、厂商工具,以及在 Intel 笔记本或未指定平台标志的 CI 运行器上构建的镜像。对于这些镜像,请明确指定:

services:
  legacy-tool:
    image: example/amd64-only-tool:1.4
    platform: linux/amd64

Oxcart 通过 Apple 的 x86-64 转译技术 Rosetta 运行 amd64 镜像;Buildx 可构建并加载 amd64 镜像,再由引擎在本地运行。可用 docker run --rm --platform linux/amd64 alpine uname -m 检查容器实际运行的架构,它会输出 x86_64。

为各服务选择平台
情况处理方法
镜像提供 arm64 版本无需操作。Compose 会拉取 arm64 版本。
镜像仅支持 amd64为服务添加 platform: linux/amd64。
部署到 amd64 服务器使用 docker buildx build --platform linux/amd64 构建要推送的镜像;如服务栈允许,本地开发仍可使用 arm64。
"exec format error"二进制文件与容器架构不匹配。请设置平台或为 arm64 重新构建。

完整示例

一个 Postgres 数据库、一个从当前文件夹构建且等待数据库健康后才启动的 API,以及一个通过 profile 启用的 amd64 专用工具:

services:
  db:
    image: postgres:17-alpine
    environment:
      POSTGRES_PASSWORD: dev
    volumes:
      - pgdata:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 2s
      timeout: 3s
      retries: 15

  api:
    build: .
    init: true
    environment:
      DATABASE_URL: postgres://postgres:dev@db:5432/postgres
    ports:
      - "127.0.0.1:8080:8080"
    depends_on:
      db:
        condition: service_healthy

  legacy-tool:
    image: example/amd64-only-tool:1.4
    platform: linux/amd64
    profiles: ["tools"]

volumes:
  pgdata:

各部分的作用:

  • healthcheck 告诉 Compose,Postgres 何时真正开始接受连接,而非仅仅已启动。
  • depends_on: condition: service_healthy 让 API 等待,直到该检查通过。
  • init: true 以 PID 1 运行轻量 init,让信号能传递给进程,并回收僵尸进程。这样 docker stop 就能正常结束,而不必等待超时。
  • 127.0.0.1:8080:8080 仅在 Mac 的回环地址上发布 API。若不指定地址,发布的端口会监听 Mac 的所有 IPv4 地址,同一网络中的其他机器也能访问。
  • pgdata 是命名卷:数据在 docker compose down 后仍保留,仅执行 down -v 时才删除。

在 Apple 芯片上运行 Compose 服务栈

  1. 检查工具。 运行 docker compose version 和 docker context show。Oxcart 随附 Docker Compose 5.6.0、docker CLI 29.9.0 和 Buildx 0.38.0,上下文名为 oxcart。
  2. 编写 compose 文件。 为应用需要等待的每个服务添加 healthcheck,并通过 depends_on: condition: service_healthy 让依赖方等待。
  3. 启动并等待健康状态。 运行 docker compose up -d --build --wait。命令会在所有服务运行且健康后返回;如有服务未达到要求,则失败。
  4. 检查端口。 运行 docker compose ps,或打开 Oxcart 的 Ports 视图。该视图会显示每个已发布端口是就绪、等待中还是失败,并说明原因。
  5. 迭代开发。 编辑代码并运行 docker compose up -d --build api。未改变的构建步骤会使用缓存。
  6. 清理。 运行 docker compose down 停止并移除容器,或运行 docker compose down -v 一并删除命名卷。

更快地重新构建

Compose 通过 Buildx 和 BuildKit 构建。安排 Dockerfile 时,将依赖安装放在 COPY . . 之前,这样修改代码就能复用其上方的所有缓存层。在 Oxcart 中,基准测试项目的缓存构建为 121 ms,使用本地上下文的无缓存构建为 341 ms,两项均是我们测试的三款运行时中最快的。每次迭代节省的时间会不断累积:docker run --rm 用时 42 ms,停止并移除 20 个容器用时 77 ms。

Oxcart 0.1.2 于 2026-10-10 使用随附的 docker 29.9 客户端测量;其他运行时于同日较早时间,使用同一台 Mac、同一套测试工具和 docker 29.4 测量。Apple M5 Max,各配置 8 个 CPU 和 12 GiB,每次仅运行一款运行时。

端口、Mac 与其他服务

  • 端口语法与 Docker 相同:支持 TCP 和 UDP、临时端口("127.0.0.1::8080"),以及用于同时监听 IPv4 与 IPv6 的 "[::]:8080:80"。TCP 和 UDP 可以共用同一个主机端口号。
  • 从容器访问 Mac:host.docker.internal 可从容器及构建步骤通过 TCP 访问绑定在 Mac 127.0.0.1 上的服务。
  • 本地镜像仓库:将仓库容器发布到端口 5000,docker push localhost:5000/app 即可访问。
  • 边车容器:network_mode: service:api 将容器放入另一个服务的网络命名空间,从而共享该服务的 localhost。

关于 VPN、DNS、防火墙及网络路径如何受到保护,请参见 Mac 上的容器网络。

命名卷与绑定挂载

数据库或构建过程需要频繁写入的数据,请使用命名卷:例如 node_modules、软件包缓存和数据库文件。数据存储在引擎自身的存储空间中。在 Oxcart 上,命名卷完成 1,000 次小文件创建、stat、读取和删除操作仅用 17.8 ms,是我们测试的三款运行时中最快的。

在 Mac 上编辑的源代码请使用绑定挂载。Oxcart 默认以可读写方式将用户主文件夹、/private/tmp 和 /private/var/folders 共享给容器;Mac 上的修改会出现在容器中,容器中的修改也会出现在 Mac 上。需要注意一个限制:在 Mac 上修改文件不会在容器内产生 inotify 事件,因此容器内的文件监视器如需感知编辑器的修改,应使用轮询。

故障排查

Apple 芯片 Mac 上的常见 Compose 问题
现象原因解决方法
exec format errorarm64 容器中运行 amd64 二进制文件,或反过来设置 platform: linux/amd64,或为 arm64 重新构建
"no matching manifest for linux/arm64"镜像没有 arm64 版本platform: linux/amd64
"address already in use"另一个进程或容器占用了主机端口更换主机端口,或在 Oxcart 的 Ports 视图中查找占用者
已发布端口拒绝连接服务器在容器内监听 127.0.0.1,或尚无程序监听监听 0.0.0.0;添加健康检查并使用 --wait
数据库就绪前应用已启动未指定条件的 depends_on 只等待启动同时使用 condition: service_healthy 与 healthcheck
docker stop 等待 10 sPID 1 忽略 SIGTERM使用 init: true,或在应用中处理 SIGTERM

常见问题

Docker Compose 支持 Apple 芯片 Mac 吗?

支持。Compose 可在 arm64 上原生运行,大多数官方镜像都提供 arm64 版本。Oxcart 包含 Docker Compose 5.6.0,兼容性检查覆盖多服务、健康检查依赖、up --wait、build、down、服务名 DNS、init: true 和 network_mode: service:。

如何在 M 系列 Mac 上运行 amd64(x86-64)镜像?

为服务设置 platform: linux/amd64,或向 docker run 传入 --platform linux/amd64。Oxcart 通过 Rosetta 运行 amd64 镜像。有原生 arm64 镜像时优先使用;没有 arm64 构建时再用 amd64。

“exec format error” 是什么意思?

容器尝试运行与自身 CPU 架构不同的二进制文件。通常是镜像或其中的二进制文件仅支持 amd64。请为该服务添加 platform: linux/amd64,或将镜像重新构建为 arm64。

容器正在运行,为什么应用仍提示“connection refused”?

最常见的原因是服务器在容器内监听 127.0.0.1。已发布端口连接的是容器网络接口,而非回环地址,因此服务器必须监听 0.0.0.0。Oxcart 的 Ports 视图会明确指出此情况。

如何让一个服务等待另一个服务就绪?

为被依赖服务添加 healthcheck,为依赖它的服务添加 depends_on: { db: { condition: service_healthy } }。这样 docker compose up --wait 就只会在所有服务都健康后返回。

容器能访问 Mac 上运行的服务器吗?

可以。使用 host.docker.internal:在 Oxcart 中,容器和构建过程可通过它以 TCP 访问绑定在 Mac 127.0.0.1 上的服务。

数据库应使用命名卷还是绑定挂载?

数据库数据请使用命名卷,存储在引擎自身的存储空间内。Mac 上编辑的源代码使用绑定挂载。在 Oxcart 上,命名卷执行 1,000 次小文件创建、stat、读取和删除操作用时 17.8 ms。

来源与方法

  • 兼容性:Oxcart 已验证的集成路径(docker CLI、带健康检查依赖的 Compose、up --wait、init: true、network_mode: service:、Buildx,以及通过 Rosetta 运行 amd64)。
  • 速度数据:Oxcart 0.1.2,2026-10-10,Apple M5 Max,8 个 CPU 和 12 GiB,预热后采样五次取中位数;其他运行时于同日较早时间,使用同一台 Mac、同一套测试工具和 docker 29.4 客户端测量。
  • 随附工具:docker 29.9.0、Docker Compose 5.6.0、Buildx 0.38.0。

在你自己的项目中试用 Oxcart

免费试用 60 天。之后购买一个许可证,终身包含所有更新,无需订阅。

配备 Apple silicon 的 Mac · Windows 11 (x64)

继续阅读

版本更新说明

Oxcart 26.11.6

最新版本

Containers see the changes you make to files on your Mac as they happen.

  • Edit a file in a shared folder on your Mac, and tools that watch it in a container, such as Vite, webpack and nodemon, reload right away. Polling is not needed.
  • When no containers are running and you haven't used Docker for two minutes, Oxcart gives the memory it was using back to macOS. The next docker command starts it again in under a second. This doesn't happen while Kubernetes is turned on.
  • You can bring your images, volumes and networks over from another Docker app. Choose Import from Another Runtime… in the More (…) menu on the Containers page, or run oxcart import. Containers themselves aren't copied: start them again with docker compose up -d or docker run, and they use the imported volumes and networks.
  • Bug fixes and optimizations.
  • Updated Linux and system components, with the latest security fixes. A Windows virtual machine that is suspended when you update starts fresh afterwards.

需要 macOS 26.0 或更高版本

Oxcart 26.11.5

You can now turn on GPU acceleration for a Windows 11 virtual machine you already have.

  • Open the virtual machine's settings and turn on GPU acceleration under Display. Oxcart restarts Windows once, and the Windows desktop and Direct3D 10 and 11 apps then render on your Mac's GPU.
  • Turning GPU acceleration off puts back the standard display driver, and suspending works again.

需要 macOS 26.0 或更高版本

Oxcart 26.11.4

Bug fixes and optimizations.

  • Virtual machines start again after updating Oxcart while it is open.

需要 macOS 26.0 或更高版本

Oxcart 26.11.3

Windows virtual machines can now use your Mac's GPU.

  • Turn on GPU acceleration when you create a Windows 11 virtual machine, on the first step of New Virtual Machine. The Windows desktop and Direct3D 10 and 11 apps then render on your Mac's GPU instead of its processor.
  • A virtual machine with GPU acceleration can't be suspended or snapshotted while it runs. Shut it down instead. Existing virtual machines are not changed.
  • GPU acceleration is new. After a lot of opening and closing windows, the Windows screen can go black for about a second while Oxcart frees graphics memory.
  • Updated Linux and system components, with the latest security fixes.

需要 macOS 26.0 或更高版本

Oxcart 26.11.2

Oxcart can now run Kubernetes for you.

  • Turn on Kubernetes in Settings › Resources to get a local single-node cluster that kubectl can use right away.
  • Services in the cluster are reachable from your Mac at 127.0.0.1, and images you build with Docker run in the cluster without pushing them to a registry.
  • Updated Linux and system components, with the latest security fixes.

需要 macOS 26.0 或更高版本

Oxcart 26.11.1

Bug fixes and optimizations.

  • A simpler toolbar in the VM window.
  • Updated Linux and system components, with the latest security fixes.

需要 macOS 26.0 或更高版本

Oxcart 26.11.0

Clearer Windows audio, a network that comes back, and a VM toolbar that stays out of your way.

  • Clear Windows audio. Choppy, garbled sound in Windows VMs is fixed.
  • Networking that recovers. Turn a Windows VM's network off and on again, and it reconnects without a restart.
  • A toolbar that stays out of the way. It no longer covers the top of your VM. Move the pointer to the top center and click the small tab when you want it.
  • Simpler Oxcart Tools for Windows. One CD now holds everything, and the installer handles the drivers and any restart for you.
  • A more dependable clipboard in Windows VMs.
  • A license agreement to accept the first time you open Oxcart on your Mac.
  • Updated Linux, container and Docker components, with the latest security fixes.

需要 macOS 26.0 或更高版本

Oxcart 26.10.0

Virtual machines are here. Windows 11, Linux and macOS run on your Mac, built into Oxcart beside your containers and covered by the license you already have.

  • Windows 11 in about 5 minutes, hands off. Choose your Windows 11 ARM installer and walk away: Oxcart installs Windows, its drivers and Oxcart Tools by itself, on a VM with real TPM 2.0 and Secure Boot. You bring the installer and the license.
  • Linux in under a minute. Ubuntu, Debian and Fedora start with your Mac username, your SSH key and passwordless sudo already set up; Fedora is ready in about 30 seconds. Every further VM from the same image starts from an instant copy that takes only the space it changes. Ubuntu Desktop, Fedora Workstation and any arm64 Linux installer work too.
  • macOS on macOS. Oxcart restores the newest macOS your Mac supports and, with Automatic setup, creates your account and installs Oxcart Tools.
  • Every VM is a real Mac app. Each one has its own window, Dock icon and ⌘-Tab entry, and keeps running after you quit Oxcart. The Retina display follows the window as you resize it or go full screen, ⌘C and ⌘V work in Linux and Windows, and text, images and files move between your Mac and the guest by copy, paste and drag.
  • Snapshots that capture the moment. Snapshot a running VM with its open apps and return to that exact moment later. Snapshots and clones take almost no space until the guest changes, and a restore lands whole even if your Mac loses power halfway.
  • Your Mac's folders, network and USB. Share Mac folders with any guest, reach your Mac by name and publish ports from the VM. Hand a USB device to Windows for flashers, programmers and dongles; development boards' serial ports show up in Windows under their own IDs.
  • First-class for coding agents. VMs join containers in Oxcart's MCP server with 22 tools of their own, so an agent you connect can create, start, snapshot and clone VMs, run commands and copy files in the guest, forward ports, connect USB devices and disk images, and read the screen and type in any guest, even one without Oxcart Tools, all within the permission level you set for each agent. The oxcart vm command covers every operation, with JSON output for scripts and CI.
  • Encrypted VMs, when you want them. Keep a VM's disks and secrets behind a password of your own, with AES-256 encryption built into Oxcart, so an encrypted disk flushes as fast as a plain one.
  • Disk space you can see. Choose where a VM lives, on your Mac or an external drive, and see what it takes now and what it can grow to against the space you have. Reclaim Space hands back what a guest frees right away, and Disk Usage shows each downloaded system so you can remove the ones you no longer need.
  • VMs that move with you. Each VM is a single item in Finder you can keep on any drive. Export it as one .oxvm file to another Mac, and bring over Linux and macOS VMs from another Mac virtualization app.
  • Ready when you are. Chosen VMs start when you log in, run headless with no window at all, and suspend when you close them, so you pick up exactly where you left off.
  • Oxcart Help. Help › Oxcart Help (⌘?) explains every setting, what it does and what changing it affects, with a ? beside each one. Coding agents read the same help through MCP.
  • More reliable published ports. A container connection that a service closes mid-transfer now ends cleanly instead of waiting.
  • New version numbers. Releases are now numbered by year and month, so this one is 26.10.0.

需要 macOS 26.0 或更高版本

Oxcart 0.1.8

Oxcart 现已支持 Windows,购买后可终身享有所有更新。

  • Oxcart 也能在 Windows 上运行。一份许可证最多可用于 5 台设备,Mac 与 Windows 可任意组合。
  • 终身包含每次更新。
  • 截至 2026 年 12 月 31 日,Oxcart 售价为 $5。
  • 编程智能体可以检查容器、读取实时统计数据和资源压力、跟踪日志、追踪耗时较长的镜像拉取和构建,并按你设置的限制运行容器。
  • 重新创建容器时会保留其卷和网络别名。
  • Oxcart 的辅助程序在“登录项”中显示为 Oxcart。
  • 全面提升可靠性。

需要 macOS 26.0 或更高版本

Oxcart 0.1.7

更快的共享文件夹、更快的网络,以及可编辑的容器环境。

  • 共享文件夹大幅提速。在共享文件夹中克隆仓库、安装软件包和构建,速度最高可达原来的 3×。
  • 网络更快。发布端口和容器连接可传输近两倍的数据,同时减少 CPU 占用。
  • 按需启用加密。Mac 与容器之间的流量加密是可选的:可在 Settings › Resources › Encrypt container connections 中开启。
  • 环境变量更易查看和修改。在容器的 Overview 中查看变量,通过 Edit and Recreate 修改变量,还能一次粘贴整个 .env 文件。
  • Run Container 面板操作更顺畅。按 Return 会移至下一行,不会启动容器。
  • 故障排查更清晰。当 VPN 或防火墙拖慢连接时,Oxcart 会告知你。
  • 共享文件夹更可靠,能正确报告权限错误,并在 Mac 上的文件发生变更后及时更新内容。

需要 macOS 26.0 或更高版本

Oxcart 0.1.6

编程智能体可以修复所发现的问题,另有全面的问题修复与安全加固。

  • 新添加的智能体可以使用 Mac 上已有的镜像来启动、停止和重启容器,在容器内运行命令,以及启动 Compose 项目。拉取、构建和删除需要 Full 权限,可在 MCP Integrations 中为每个智能体分别设置。
  • 设置时会为每个智能体提供可直接使用的配置条目,运行 oxcart mcp check 可确认其是否正常工作。
  • 回答更准确:智能体能识别服务是否因其依赖的服务停机而停机、网页是否确实能加载,以及故障的原因和修复方法。
  • Start at login 会在登录时将 Oxcart 启动到菜单栏,随时可用。
  • Oxcart 启动时会检查更新,并向 oxcart.cc 发送一条简短的联络请求。Settings › Privacy 中会完整显示其中包含的内容。
  • 容器从启动之初就能发现所在网络中的其他服务。
  • 修复了特权容器、Rosetta 检查和设置过程中的安全防护问题。
  • Oxcart 应用会在执行任何删除数据或停止正在运行的任务的操作前征求确认。
  • 全面加强安全防护并提升可靠性。

需要 macOS 26.0 或更高版本

Oxcart 0.1.5

Oxcart 支持运行本地 Kubernetes 和特权容器,并提供十种语言。

  • 在 Settings › Resources › Kubernetes and networking 中开启特权容器,即可运行 kind、k3d、minikube(Docker 驱动)和 Docker-in-Docker,并使用 docker run --privileged 和 --device。此功能默认关闭。Oxcart 的防护机制会阻止每个容器访问 Oxcart 的磁盘、内核、其他容器的数据,以及 Oxcart 与 Mac 之间的通信通道。
  • 支持 IPv6 容器网络,此功能也默认关闭,适用于使用 IPv6 创建的网络,例如 kind 的双栈网络。
  • Oxcart 已翻译为简体中文、日语、德语、法语、西班牙语、巴西葡萄牙语、韩语、俄语和土耳其语。Settings › General › Language 中的语言设置仅对 Oxcart 生效。

需要 macOS 26.0 或更高版本

Oxcart 0.1.4

许可证功能与细节改进。

  • 通过安全邮件链接激活许可证。
  • 在 Settings 中管理许可证和 Mac。
  • 离线验证许可证。
  • 性能提升、界面优化与问题修复。

需要 macOS 26.0 或更高版本

Oxcart 0.1.3

空闲时回收内存。

  • 没有容器运行时回收 VM 内存。
  • 保留容器、镜像、卷和网络。

需要 macOS 26.0 或更高版本

Oxcart 0.1.2

命令行工具集成。

  • 在 Oxcart 自带的 Docker 工具与已安装的 Docker 工具之间切换。
  • 界面优化。

需要 macOS 26.0 或更高版本

Oxcart 0.1.1

内置 Docker 工具与智能体控制。

  • 自带 Docker CLI 29.9、Compose 5.6 和 Buildx 0.38。
  • Docker 上下文集成与安全的钥匙串凭据存储。
  • MCP 智能体连接,支持为各智能体设置权限或阻止访问。

需要 macOS 26.0 或更高版本

Oxcart 0.1.0

适用于 Apple 芯片的 Docker 兼容容器。

  • 兼容 Docker CLI、Compose 和 Buildx。
  • 自带运行时组件,可离线设置。
  • 按项目和 Git 分支整理端口。
  • MCP 集成,默认仅允许只读访问。
  • 经过验证的自动更新。

需要 macOS 26.0 或更高版本