Apple container:Mac 原生 Linux 容器不是 Docker Desktop 替代品那麼簡單
Apple 官方開源 container 1.0,用 Swift 與 macOS Virtualization/vmnet/XPC/Keychain 等框架,在 Apple silicon Mac 上以每個容器一個輕量 VM 的方式執行 Linux 容器。它相容 OCI image 與 registry,適合觀察 Mac 開發環境的下一代容器路線,但仍需注意 macOS 26 需求、功能成熟度與 Docker 生態差距。
Developer Tools · macOS · Containers
Apple 把「Mac 上跑 Linux 容器」做成官方 Swift 原生工具
這則 Threads 提到的 apple/container 確實是 Apple 官方 GitHub 專案:它在 Apple silicon Mac 上用輕量 VM 執行 Linux containers,支援 OCI-compatible images,可從標準 container registry pull,也能 build / push image。
真正值得記住的不是「Docker Desktop 會不會被取代」,而是 Apple 正在把 macOS 的容器開發體驗往 Virtualization framework + vmnet + XPC + Keychain + launchd 的原生系統整合方向推進。
定位
container 是 Apple 官方 CLI,用來在 Mac 上建立、執行、建置與推送 Linux container images。
核心差異
不是把所有 Linux containers 放進一台共享 Linux VM,而是為每個 container 建立輕量 VM,以換取更強隔離與更細的資料掛載邊界。
相容性
使用 OCI-compatible images,可與 Docker Hub / 標準 registry 互通;build 出來的 image 也可在其他 OCI-compatible 工具中使用。
限制
官方 README 明確寫到主要支援 macOS 26 與 Apple silicon;許多 Docker Desktop / Compose / Kubernetes 周邊工作流仍需實測。
官方專案狀態
| Repo | apple/container |
|---|---|
| 描述 | A tool for creating and running Linux containers using lightweight virtual machines on a Mac. Written in Swift and optimized for Apple silicon. |
| 語言 / 授權 | Swift / Apache-2.0 |
| 官方文件 | apple.github.io/container/documentation/ |
| 最新 release | 1.0.0,發布於 2026-06-09;提供 signed installer pkg。 |
| GitHub 熱度 | 查詢時約 29.4K stars、820 forks、298 open issues;這是時間敏感指標,只代表當下社群關注度。 |
它怎麼跑 container?
官方 technical overview 說明,macOS 上常見做法是啟動一台 Linux VM,再把所有 Linux containers 放進這台 VM。Apple container 的設計不同:它透過開源 Swift package,為每個 container 建立一個 lightweight VM。