Oxcart 下载
菜单

Mac 上的 Dev Containers 和 Testcontainers

让项目环境保持一致,让集成测试更快。Oxcart 通过你熟悉的 Docker 工具,在 Apple 芯片 Mac 上运行 Dev Containers 和 Testcontainers。实测每次 API 创建为 2.5 ms,拆除 20 个容器为 77 ms,均是我们测试的三款运行时中最快的,让一次性测试环境减少等待。

更新于

为什么引擎会影响测试

Testcontainers 测试套件会为测试类启动真正的 Postgres、Kafka 或 Redis,结束后将其丢弃。Dev Container 会重建并重启项目的整套工具链。两者的时间都花在反复创建、启动、停止和移除容器的生命周期调用上,而这些调用正是 Oxcart 最快的地方。

测试套件执行的容器生命周期调用,在 Oxcart 中测量
操作Oxcart 0.1.2与次快工具相比
通过 API 创建(不经过 CLI)2.5 ms7×
通过 API 启动18.5 ms2.1×
通过 API 停止4.0 ms21×
创建并启动 20 个容器0.69 s2.5×
停止并删除 20 个容器77 ms8.9×
docker run --rm … true42 ms3.4×

Oxcart 0.1.2 于 2026-10-10 使用随附的 docker 29.9 客户端测量;其他运行时于同日较早时间,使用同一台 Mac、同一套测试工具和 docker 29.4 测量。Apple M5 Max,各配置 8 个 CPU 和 12 GiB,每次仅运行一款运行时,五次采样取中位数。完整表格:比较页面。

将 Dev Containers 和 Testcontainers 连接到 Oxcart

  1. 安装并打开 Oxcart。 设置会创建名为 oxcart 的 Docker 上下文。仅在没有使用其他上下文时才将其设为当前上下文,因此请用 docker context show 检查。
  2. 将 docker 命令指向 Oxcart。 运行 docker context use oxcart,或在 Settings › Command line tools 中开启 Use Oxcart for the docker command。关闭后会恢复之前的上下文。
  3. 为测试框架提供套接字。 对于读取 DOCKER_HOST 而非 Docker 上下文的工具,从上下文导出它:export DOCKER_HOST=$(docker context inspect oxcart --format '{{.Endpoints.docker.Host}}')。
  4. 运行测试。 照常运行测试套件。Testcontainers 会通过 Docker Engine API 创建、启动和移除容器。
  5. 打开 Dev Container。 在项目的 Dev Container 中打开项目,或使用 Dev Containers CLI 运行 devcontainer up --workspace-folder .。

Testcontainers

Testcontainers 库(Java、Go、Node、Python、.NET 等)直接与 Docker Engine API 通信,而非通过 docker CLI。Oxcart 协商的 API 版本为 1.54,并接受 1.40 至 1.54,因此当前 Testcontainers 版本只要找到套接字,无需特殊设置即可连接。

查找套接字

Testcontainers 优先查看 DOCKER_HOST。Oxcart 的套接字位于私有状态文件夹中,权限为 0600,路径保存在 oxcart Docker 上下文内。每个 shell 导出一次,或在 IDE 的测试配置中设置:

export DOCKER_HOST=$(docker context inspect oxcart --format '{{.Endpoints.docker.Host}}')
./gradlew test        # or: mvn verify, go test ./..., pytest, npm test

辅助容器与容器内套接字

Testcontainers 会启动一个小型辅助容器,在测试运行崩溃后进行清理;有些配置则在容器内运行测试。两者都会挂载 Docker 套接字。在 Oxcart 中,-v /var/run/docker.sock:/var/run/docker.sock 让容器从 Linux 一侧内部访问同一 Docker API,因此辅助容器、docker-outside-of-docker、Portainer 和 Traefik 均可按预期运行。如果工具尝试将 Mac 端的 DOCKER_HOST 路径挂载进容器,Testcontainers 的标准设置 TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE 可告知它改为挂载 /var/run/docker.sock。

从 Dockerfile 构建的镜像

Testcontainers 可以在测试中从 Dockerfile 构建镜像(ImageFromDockerfile 及其对应功能)。这会使用 Engine API 的构建端点,Oxcart 基于 BuildKit 实现该端点,支持 tar 上下文(普通和 gzip)、构建参数、标签元数据和多个镜像标签。

Dev Containers

Dev Container 用容器定义项目工具链,Dev Containers 工具(VS Code 扩展、devcontainer CLI 及使用它的编辑器)通过 docker CLI 构建并运行它。将 oxcart 设为当前上下文后,执行这些操作的就是 Oxcart。

连同工具链和配套服务一起打开项目。Dev Containers CLI 会将工作区与 Postgres、Redis 等服务一并启动;非 root 的 node 用户可编辑工作区,项目的创建后脚本会准备依赖。团队成员通过同一份配置获得相同环境。

npm install -g @devcontainers/cli
devcontainer up --workspace-folder .
devcontainer exec --workspace-folder . bash

Apple 芯片上使用 Dev Containers 的建议

  • 架构:大多数 Dev Container 基础镜像提供 arm64 版本。对于仅支持 amd64 的镜像,Oxcart 通过 Rosetta 运行;参见 Apple 芯片上的 Docker Compose。
  • 将依赖放在卷中:把 node_modules、软件包缓存和数据库数据放在命名卷中,源代码则留在绑定挂载的工作区。
  • 文件监视:Mac 上的编辑不会在容器内产生 inotify 事件,因此容器内运行的监视器应使用轮询。
  • 编程智能体:在 Dev Container 内运行的智能体,其 shell 保持在项目容器内;在 Mac 上运行的智能体可通过 Oxcart 的 MCP 服务器检查 Dev Container 的服务(面向 AI 编程智能体的 Docker)。

Docker 上下文,行为清晰可控

Oxcart 在设置时创建 oxcart 上下文,只有不会影响已有使用时才将其设为当前上下文:即当前上下文为 default 且其套接字无响应。其他情况下会保留当前上下文。Settings › Command line tools 中的 Use Oxcart for the docker command 可切换到 oxcart 并记住原上下文;关闭后即可切回。Oxcart 从不在 Mac 上创建或替换 /var/run/docker.sock,API 也从不通过 TCP 开放。

常见问题

Testcontainers 能在 Apple 芯片 Mac 上通过 Oxcart 使用吗?

可以。Testcontainers 与 Oxcart 实现的 Docker Engine API(版本 1.40 至 1.54)通信,包括 Testcontainers 从 Dockerfile 构建镜像时使用的构建端点。容器也可在 /var/run/docker.sock 挂载 Docker 套接字,这正是 Testcontainers 辅助容器所预期的位置。

如何为 Testcontainers 设置 DOCKER_HOST?

从 oxcart Docker 上下文读取:docker context inspect oxcart --format '{{.Endpoints.docker.Host}}' 会输出 unix:// 路径。在 shell 或 IDE 的测试运行配置中将其导出为 DOCKER_HOST。

为什么使用 Oxcart 后集成测试更快?

测试套件的大量时间用于创建、启动、停止和移除容器。在同一台 Mac 上,Oxcart 实测每次 API 创建 2.5 ms、API 启动 18.5 ms、API 停止 4.0 ms,停止并移除 20 个容器 77 ms:每项都是我们测试的三款运行时中最快的。

VS Code Dev Containers 支持 Oxcart 吗?

Dev Containers CLI 0.89.0 在 Oxcart 上构建并启动了真实的多服务配置,Postgres 和 Redis 均健康,容器用户可写入工作区。Dev Containers 工具通过 docker CLI 工作,因此请用 oxcart 上下文将 CLI 指向 Oxcart。

Dev Container 中能使用 docker-outside-of-docker 吗?

可以。将 /var/run/docker.sock 挂载到容器中,容器内的 docker CLI 就能与同一引擎通信。Oxcart 的私有端点会拒绝通过该套接字的访问,因此容器可以管理容器,但无法访问 Oxcart 自身内部功能。

Oxcart 会替换 Mac 上的 /var/run/docker.sock 吗?

不会。Oxcart 从不在 Mac 上创建或替换 /var/run/docker.sock。客户端通过 oxcart Docker 上下文或该上下文指定的套接字路径访问引擎。

来源与方法

  • 兼容性:Oxcart 已验证的集成路径(docker-py 和 Testcontainers 使用的 Engine API 构建、Dev Containers CLI 0.89.0、容器内 Docker 套接字)及 API 版本范围。
  • Docker 上下文选择与命令行设置:以发布版 Oxcart 为准。
  • 速度数据:Oxcart 0.1.2,2026-10-10,Apple M5 Max,8 个 CPU 和 12 GiB;其他运行时于同日较早时间,使用同一台 Mac、同一套测试工具和 docker 29.4 客户端测量。

在你自己的项目中试用 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 或更高版本