container README

The project's README from github.com/apple/container. As one markdown file: README.md.

Containerization logo  container

container is a tool that you can use to create and run Linux containers as lightweight virtual machines on your Mac. It's written in Swift, and optimized for Apple silicon.

The tool consumes and produces OCI-compatible container images, so you can pull and run images from any standard container registry. You can push images that you build to those registries as well, and run the images in any other OCI-compatible application.

container uses the Containerization Swift package for low-level container, image, and process management.

introductory movie showing some basic commands

Get started

Requirements

You need a Mac with Apple silicon to run container. To build it, see the BUILDING document.

container is supported on macOS 26, since it takes advantage of new features and enhancements to virtualization and networking in this release. We do not support older versions of macOS and the container maintainers typically will not address issues that cannot be reproduced on macOS 26.

Initial install

Download the latest signed installer package for container from the GitHub release page.

To install the tool, double-click the package file and follow the instructions. Enter your administrator password when prompted, to give the installer permission to place the installed files under /usr/local.

Start the system service with:

container system start

Run your first container

container run --rm alpine echo hello

This pulls the alpine image, runs it in a lightweight Linux VM, prints hello, and removes the container when it exits. See the tutorial for a fuller walkthrough that builds and publishes an image of your own.

Upgrade or downgrade

For both upgrading and downgrading, you can manually download and install the signed installer package by following the steps from initial install or use the update-container.sh script (installed to /usr/local/bin).

If you're upgrading or downgrading, you must stop your existing container:

container system stop

To upgrade to the latest release, simply run the command below:

/usr/local/bin/update-container.sh

To downgrade, you must uninstall your existing container (the -k flag keeps your user data, while -d removes it):

/usr/local/bin/uninstall-container.sh -k
/usr/local/bin/update-container.sh -v 0.3.0

Start the system service with:

container system start

Uninstall

Use the uninstall-container.sh script (installed to /usr/local/bin) to remove container from your system. To remove your user data along with the tool, run:

/usr/local/bin/uninstall-container.sh -d

To retain your user data so that it is available should you reinstall later, run:

/usr/local/bin/uninstall-container.sh -k

Next steps

Contributing

Contributions to container are welcome and encouraged. Please see our main contributing guide for more information.

Project Status

The container project is under active development. Its release versions are product versions, not semantic versions.

The container CLI compatibility generally preserves backward compatibility within a major release (not breaking existing scripts), however, there may be the odd case where breaking compatibility may be necessary. Note: Features marked experimental (for example, the k8s subcommand) may change and do not guarantee backward compatibility.

The container-apiserver XPC API compatibility preserves forward and backward compatibility within a major version. Other non-public XPC helpers do not guarantee CLI or API compatibility across different versions.

The container application data provides forward compatibility only, guaranteed within one major version. Upgrading to a newer major version may require a specific upgrade path.

container (apple/container)

Searching Database…

50.7K ·GitHub
这是什么?一款在 Mac 上创建和运行 Linux 容器的工具,容器以轻量级虚拟机的形式运行,专为 Apple silicon 优化。
这是 Docker 的替代品,还是别的什么?它是一个命令行工具,可以读取和生成兼容 OCI 的容器镜像,因此用法与 Docker 类似,但每个容器都运行在自己的轻量级虚拟机中,而不是共享同一个内核。
我该如何安装和运行?从 GitHub 发布页面下载最新的已签名安装包,双击打开,输入管理员密码,然后启动系统服务并运行容器,例如拉取并运行 alpine 镜像。
运行它需要什么样的 Mac?需要搭载 Apple silicon 芯片的 Mac;如果要从源代码构建,请参阅单独的 BUILDING 文档。
它能在较旧的 macOS 版本上运行吗?不能,它只支持 macOS 26,因为它依赖该版本中新的虚拟化和网络功能;维护者也不会处理无法在该版本上复现的问题。
它也能在 Intel 芯片的 Mac 上运行吗?不能,它是专为 Apple silicon 打造的,不支持 Intel 芯片的 Mac。
我可以把自己构建的镜像推送到镜像仓库吗?可以,你可以把用 container 构建的镜像推送到任何标准镜像仓库,并在其他任何兼容 OCI 的应用中运行。
它在底层如何管理容器?它使用 Containerization Swift 软件包来进行底层的容器、镜像和进程管理。
我该如何升级或卸载它?你可以下载新的已签名安装包进行安装,使用 update-container.sh 脚本进行升级或降级,或运行 uninstall-container.sh 卸载(加 -k 保留用户数据,加 -d 则彻底删除)。
k8s 子命令稳定吗?不稳定,标记为实验性的功能(例如 k8s 子命令)可能会发生变化,并且不保证向后兼容。
What are similar projects?podman, runc, arcbox, grype, colima, tart, buildkit, lima
Creator
apple
Size
10 MB
Stars
50.7K
Age
1y
Commits · 90 Days