Containerization, the official open source Swift package for running Linux containers on Apple's macOS

At its annual developer conference,
GitHub - apple/containerization: Containerization is a Swift package for running Linux containers on macOS.
https://github.com/apple/containerization

Meet Containerization - WWDC25 - Videos - Apple Developer
https://developer.apple.com/videos/play/wwdc2025/346/
Linux containers have become the standard for how server-side applications are built, tested, and deployed. When deploying server-side workloads at scale, they need to run in different environments. Containers allow you to isolate workloads not only from the host machine, but also from each other. Containers also allow you to replicate the deployment environment on your local machine, allowing you to develop and test your applications locally as if they were running in production.
To run Linux containers on macOS, you need to virtualize your Linux environment. The traditional solution is to spawn a large virtual machine to host all your running containers.
When Apple was considering how to introduce Linux containers to macOS, it was aiming to provide each container with the same level of isolation as large-scale virtual machines. It also aimed to reduce the need for core utilities and dynamic libraries inside the virtual machine. By achieving these two points, the attack surface would be reduced and the maintenance costs of keeping the virtual machine up to date would be reduced.
Built with this in mind is Containerization, an open source Swift framework for applications written in Swift that provides APIs for image management, container execution, and a powerful init system built in Swift, and uses Virtualization , a framework on Apple silicon.
The following APIs are available for Containerization.
・Manage
Interacting with remote registries
- Create and populate the ext4 file system
Interacting with the Netlink socket family
Creating an optimized Linux kernel for faster boot times
・Create a lightweight virtual machine
・Manage virtual machine runtime environments
Create and interact with containerized processes
Uses Rosetta 2 when running x86_64 processes on Apple Silicon
Containerization runs each Linux container in its own lightweight virtual machine. Clients can create a dedicated IP address for each container, eliminating the need for separate port forwarding. Containers use an optimized Linux kernel configuration and a minimal root filesystem with a lightweight init system, resulting in sub-second startup times.
vminitd is a small init system that is a subproject of Containerization. It is spawned as the initial process within the vminitd virtual machine and provides a gRPC API over vsock that allows you to configure the runtime environment and launch containerized processes, and when running, the vminitd process can provide I/O, signals, and events to the calling process.

Apple lists some examples of use cases for Containerization, including ' operating OCI images ,' ' logging into a container registry ,' ' creating a root filesystem block ,' and ' running a simple Linux container .'
A Containerization CLI is also available.
GitHub - apple/container: A tool for creating and running Linux containers using lightweight virtual machines on a Mac. It's written in Swift, and optimized for Apple silicon.
https://github.com/apple/container

Apple's Containerization announcement has also become a hot topic on the social news site Hacker News , with one comment praising the project, saying, 'This is one of the projects Apple has recently published on GitHub that we expect will encourage more fruitful collaboration among developers.'
Also, will this dramatically improve gaming on Mac? Valve has made games more reliable thanks to Steam Deck, and the Linux gaming experience is getting better every year. Maybe it will be possible to run games in a virtual Linux environment instead of using Apple's Metal or similar tools? That would also be useful for game developers, who would only have to build for Windows, Linux, and consoles.
In response to the comment , 'I'm curious what Docker thinks about this. I'm sure there's Docker for Desktop on Mac...', one user replied, 'This doesn't conflict with Docker for Desktop. It's lower level than that. Docker for Desktop is built on top of container/virtualization software (Hypervisor.framework and QEMU on Mac, WSL on Windows, containerd on Linux). So it's likely that a future version of Docker for Desktop will use this library, but it won't actually conflict with it.'
Related Posts: