macOS Containers 是一个可以在 macOS 中运行 macOS 的 Docker 容器。
https://macoscontainers.org/assets/images/showcase.png
这个镜像很大…很大,安装方式略有不同:
GitHub:https://github.com/macOScontainers/homebrew-formula
必须
- macOS Catalina or newer
- 关闭 System Integrity Protection. SIP 不允许
chroot
. - 安装 Homebrew
# Install packages
brew install --cask macfuse
brew install docker docker-buildx macOScontainers/formula/bindfs macOScontainers/formula/containerd macOScontainers/formula/dockerd macOScontainers/formula/rund
# Start services
sudo brew services start containerd
sudo brew services start dockerd
# Set up BuildKit
mkdir -p ~/.docker/cli-plugins
ln -sfn /opt/homebrew/opt/docker-buildx/bin/docker-buildx ~/.docker/cli-plugins/docker-buildx
使用
授权 GitHub Container Registry 教程.
echo <YOUR_ACCESS_TOKEN> | docker login ghcr.io -u <GITHUB_USERNAME> --password-stdin
运行你的第一个 macOS 容器
docker run --rm -it ghcr.io/macoscontainers/macos-jail/ventura:latest echo "Hello from macOS container ^_^"