Oxcart 下载
菜单

在 Mac 上为 AWS ECS、EKS、Fargate 和 Lambda 进行本地开发

在 Apple 芯片 Mac 上测试 AWS 容器工作负载时,运行将要部署的同一镜像:将 ECS 和 Fargate 任务作为 Compose 项目运行,使用 AWS 内置 Runtime Interface Emulator 运行 Lambda 容器镜像,并通过 LocalStack 使用 AWS API。Oxcart 让迭代更快,容器启动只需 42 ms,并通过 Rosetta 运行 amd64 镜像。

更新于

各组件在哪里运行

AWS 容器服务及其在 Oxcart 上的本地替代方案
AWS 服务本地替代方案本地工作流
ECS 任务、Fargate 任务Docker Compose 搭配任务镜像配合健康检查和已发布端口,一起运行各服务
Lambda(容器镜像)包含 Runtime Interface Emulator 的 Lambda 基础镜像在原生 arm64 上通过 HTTP 调用函数
S3 及其他 AWS APILocalStack在本地开发 S3 存储桶与对象操作
EKSkubectl 和 k9s 连接真实集群;kwok 提供本地 API本地构建和测试,再用 kubectl 和 k9s 操作集群

将 ECS 和 Fargate 任务作为 Compose 项目运行

ECS 任务定义是一组容器,包含镜像、环境、端口映射、健康检查和启动顺序。Compose 描述的也是这些内容,因此可以直接转换:每个容器定义对应一个服务。

任务定义字段及其 Compose 对应项
任务定义compose.yaml
imageimage
environment, secretsenvironment、env_file(不要将真实机密放入文件)
portMappingsports
healthCheckhealthcheck
dependsOn 搭配 HEALTHYdepends_on 搭配 condition: service_healthy
runtimePlatform.cpuArchitectureplatform: linux/amd64 或 linux/arm64
services:
  api:
    image: ACCOUNT.dkr.ecr.us-east-1.amazonaws.com/api:1.4.0
    platform: linux/amd64          # match the task's cpuArchitecture
    environment:
      DATABASE_URL: postgres://postgres:dev@db:5432/app
    ports: ["8080:8080"]
    depends_on:
      db:
        condition: service_healthy
  db:
    image: postgres:17-alpine
    environment:
      POSTGRES_PASSWORD: dev
      POSTGRES_DB: app
    healthcheck:
      test: ["CMD", "pg_isready", "-U", "postgres"]
      interval: 2s
      retries: 30
docker compose up -d --wait     # returns when db is healthy and api has started
curl localhost:8080/health
docker compose down -v

我们在 Oxcart 上使用 Postgres 17 和受 service_healthy 条件约束的 nginx 服务验证了此模式:up --wait 返回时,两者均健康,已发布端口可通过 localhost 响应。对于在 Mac 上构建的 amd64 镜像,运行时也需传入相同平台;本地构建的 amd64 专用镜像只有设置 --platform linux/amd64(或 Compose 中的 platform:)才能找到。

在本地运行并调用 Lambda 容器镜像

  1. 编写处理函数。 创建 app.py,定义返回字典的 handler(event, context) 函数,例如 {"statusCode": 200, "body": "hello"}。
  2. 编写 Dockerfile。 以包含 Runtime Interface Emulator 的 AWS Lambda 基础镜像开始:FROM public.ecr.aws/lambda/python:3.13,然后添加 COPY app.py ${LAMBDA_TASK_ROOT}/ 和 CMD ["app.handler"]。
  3. 构建镜像。 运行 docker build -t my-lambda .。如果函数配置为 x86_64,请添加 --platform linux/amd64。
  4. 运行。 运行 docker run -d -p 9000:8080 my-lambda。模拟器在容器内监听端口 8080。
  5. 调用。 运行 curl -XPOST localhost:9000/2015-03-31/functions/function/invocations -d '{}'。响应就是处理函数的返回值,docker logs 会显示带耗时的 Lambda REPORT 行。

测试中,函数返回 {"statusCode": 200, "body": "hello from lambda on aarch64"},容器日志显示 Lambda REPORT 行,耗时 19 ms。模拟器由 AWS 提供,是“Lambda Runtime 和 Extensions API 的代理”,提供 /2015-03-31/functions/function/invocations 端点。

通过 LocalStack 使用 AWS API

LocalStack 在端口 4566 的单个容器中模拟 AWS API。我们在 Oxcart 上运行了 4.9 镜像,并对 S3 进行端到端验证:

docker run -d --name localstack -p 4566:4566 localstack/localstack:4.9
curl -s localhost:4566/_localstack/health          # s3, lambda, dynamodb… "available"
curl -X PUT localhost:4566/my-bucket               # create a bucket
curl -X PUT --data-binary hello localhost:4566/my-bucket/hello.txt
curl localhost:4566/my-bucket/hello.txt            # hello

基于它开发前,先了解许可证条件。自 2026 年 3 月 23 日起,最新 LocalStack 版本需要 LocalStack 账户和身份验证令牌;若未设置 LOCALSTACK_AUTH_TOKEN,最新镜像会报“License activation failed”并退出。LocalStack 免费 Hobby 套餐仅供非商业使用,ECS 从 Base 套餐起提供,EKS 从 Ultimate 套餐起提供。

推送到 ECR 并部署

aws ecr get-login-password --region us-east-1 \
  | docker login --username AWS --password-stdin ACCOUNT.dkr.ecr.us-east-1.amazonaws.com
docker buildx build --platform linux/amd64 --load -t ACCOUNT.dkr.ecr.us-east-1.amazonaws.com/api:1.4.0 .
docker push ACCOUNT.dkr.ecr.us-east-1.amazonaws.com/api:1.4.0

Oxcart 将仓库密码保存在 macOS 钥匙串中,而非 ~/.docker/config.json。Oxcart 不支持推送多平台镜像:请为每种架构推送一个标签,或通过 CI 发布多架构清单。

从 Mac 使用 EKS

aws eks update-kubeconfig --name my-cluster 将集群添加到 kubeconfig,让你能从 macOS 使用 kubectl 和 k9s。用 Oxcart 在本地开发并测试服务,再将同一镜像部署到 EKS。对于本地清单和控制器测试,kwok 提供真实的 Kubernetes API 服务器和模拟节点。Mac 上的 Kubernetes 指南介绍了如何配合使用这些工作流。

本地迭代为何值得

每次在本地测试修改,都能省去推送、部署和查找日志的过程。Oxcart 缩短了迭代周期:docker run --rm 为 42 ms,创建并启动 20 个容器为 0.69 s,停止并移除为 77 ms,是我们测试的三款运行时中最快的。容器的出站连接由 Mac 发起,因此通往 AWS 网络的 VPN 也同样适用。

常见问题

如何在 Mac 上本地测试 ECS 或 Fargate 任务?

用 Docker Compose 运行任务的容器:每个容器定义对应一个服务,保持相同镜像、环境、端口映射、健康检查和依赖关系。docker compose up -d --wait 会在所有设有健康检查的服务都健康后返回。Oxcart 运行支持健康检查依赖和已发布端口的服务栈,让你在部署前一起验证各服务。

能在 Apple 芯片上本地运行 AWS Lambda 容器镜像吗?

可以。AWS Lambda 基础镜像包含 Runtime Interface Emulator。我们在 Oxcart 上基于 public.ecr.aws/lambda/python:3.13 构建了 Python 3.13 函数,用 -p 9000:8080 运行并用 curl 调用:它在 arm64 上原生运行,返回 HTTP 200。

LocalStack 能在 Oxcart 上使用吗?

可以,作为容器运行。我们使用 LocalStack 4.9 镜像,通过 localhost:4566 验证了 S3 存储桶创建及对象 put、get、list 操作。当前 LocalStack 版本需要 LocalStack 账户和身份验证令牌,通过 LOCALSTACK_AUTH_TOKEN 设置;未提供时最新镜像会退出。LocalStack 文档注明,ECS 从 Base 套餐起提供,EKS 从 Ultimate 套餐起提供。

如何从 Mac 将镜像推送到 Amazon ECR?

用 aws ecr get-login-password --region REGION | docker login --username AWS --password-stdin ACCOUNT.dkr.ecr.REGION.amazonaws.com 登录,然后打标签并执行 docker push。在 Oxcart 中,docker login 将密码存储在 macOS 钥匙串中。

Fargate 应构建 amd64 还是 arm64 镜像?

与任务定义的运行平台保持一致。如果使用 ARM64,就在 Mac 上构建原生 arm64 镜像;如果使用 X86_64,则用 --platform linux/amd64 构建。Oxcart 通过 Rosetta 在本地运行 amd64 镜像,让你能测试将要部署的同一镜像。

如何在 Mac 上为 EKS 开发?

用 Oxcart 在本地构建和测试应用及其依赖,再将镜像推送到 ECR。在 Mac 上用 kubectl 和 k9s 操作 EKS 集群,并在 Oxcart 上用 kwok 对本地 Kubernetes API 检查清单。参见 Mac 上的 Kubernetes 指南。

来源与方法

  • 示例于 2026-10-10 使用 Oxcart 0.1.2、Mac17,14、macOS 27.2 测试(Compose、带模拟器的 Lambda 基础镜像、LocalStack 4.9 S3、Buildx)。
  • LocalStack 身份验证: https://blog.localstack.cloud/localstack-single-image-next-steps/;套餐: https://localstack.cloud/pricing/;ECS: https://docs.localstack.cloud/aws/services/ecs/;EKS: https://docs.localstack.cloud/aws/services/eks/。
  • Lambda Runtime Interface Emulator: https://github.com/aws/aws-lambda-runtime-interface-emulator。AWS SAM CLI 与 Docker: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-docker.html。ECS Local Container Endpoints: https://github.com/awslabs/amazon-ecs-local-container-endpoints。核实日期:2026-10-10。
  • 容器速度: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 或更高版本