explaingit

apple/containerization

8,541SwiftAudience · developerComplexity · 4/5Setup · hard

TLDR

A Swift library from Apple that lets macOS apps run Linux containers, each isolated in its own fast-booting virtual machine on Apple silicon hardware.

Mindmap

mindmap
  root((containerization))
    What it does
      Run Linux containers
      Fast VM per container
      OCI image support
    Tech stack
      Swift
      Apple Virtualization
      Rosetta 2
    Use cases
      Mac dev environments
      CI testing on Mac
      Container tooling
    Audience
      macOS developers
      DevOps on Mac
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Build a macOS app that pulls and runs Docker-format images locally without Docker Desktop installed.

USE CASE 2

Create isolated Linux environments on Apple silicon for CI/CD testing or development sandboxes.

USE CASE 3

Develop tools that manage OCI container images programmatically and launch processes inside running containers.

Tech stack

SwiftmacOSOCIVirtualization frameworkRosetta 2

Getting it running

Difficulty · hard Time to first run · 1h+

Requires macOS 26 and Apple silicon hardware, no Intel Mac support.

In plain English

Containerization is an open-source Swift library from Apple that lets macOS applications run Linux containers. Containers are a way to package and run software in an isolated environment, similar in concept to a lightweight virtual machine but more focused on running a single application or process. Docker is the most well-known tool for containers, and this library makes that same container format work natively on a Mac. The way it works is that each container gets its own small virtual machine, using Apple's built-in Virtualization framework that is available on Apple silicon chips. Running each container in its own virtual machine gives stronger isolation than most container systems, but the design is optimized so containers start in under a second. A custom minimal Linux kernel configuration, included in the repository, is what makes the fast boot times possible. The library provides building blocks for working with containers programmatically: managing container images in the standard OCI format (the same format Docker uses), pulling images from registries like Docker Hub, creating the file systems containers run on, spawning the virtual machines, and launching processes inside running containers. There is also support for running Intel-based Linux containers on Apple silicon using Apple's Rosetta 2 translation layer. This is a developer library, not a ready-made command-line tool. If you want a command-line interface for running containers on a Mac, Apple maintains a separate companion project called apple/container. The library targets macOS 26 and requires Apple silicon hardware. The project is written entirely in Swift, is in active early development (version 0.1.0 is the first official release), and welcomes external contributions.

Copy-paste prompts

Prompt 1
Using the apple/containerization Swift library, write code to pull an Ubuntu image from Docker Hub and start a container that runs a shell command.
Prompt 2
Show me how to use apple/containerization to run an Intel Linux binary on Apple silicon using the Rosetta 2 translation layer.
Prompt 3
Write a Swift app with apple/containerization that lists all local OCI images and launches a new container from a chosen image name.
Prompt 4
How do I spawn a virtual machine and execute a process inside a Linux container using the apple/containerization API in Swift?
Open on GitHub → Explain another repo

← apple on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.