Containerization is a Swift package for running Linux containers on macOS

by gokon 6/9/2025, 8:53 PMwith 409 comments

by commandersakion 6/9/2025, 10:41 PM

Video about it here: https://developer.apple.com/videos/play/wwdc2025/346/

Looks like each container gets its own lightweight Linux VM.

Can take it for a spin by downloading the container tool from here: https://github.com/apple/container/releases (needs macOS 26)

by sangeeth96on 6/9/2025, 10:22 PM

The CLI from the press release/WWDC session is at https://github.com/apple/container which I think is what many like myself would be interested in. I was hoping this'd be shipped with the newest Xcode Beta but that doesn't seem to be the case. Prebuilt packages are missing at the moment but they are working on it: https://github.com/apple/container/issues/54

by candiddevmikeon 6/9/2025, 9:43 PM

Wonder how Docker feels about this. I'd assume a decent amount of Docker for Desktop is on Mac...

by pxcon 6/10/2025, 12:06 AM

This is the most surprising and interesting part, imo:

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

This is quite unusual for Apple, isn't it? WebKit was basically a hostile fork of KHTML, Darwin has been basically been something they throw parts of over the wall every now and then, etc.

I hope this and other projects Apple has recently put up on GitHub see fruitful collaboration from user-developers.

I'm a F/OSS guy at heart who has reluctantly become a daily Mac user due to corporate constraints that preclude Linux. Over the past couple of years, Apple Silicon has convinced me to use an Apple computer as my main laptop at home (nowadays more comparable, Linux-friendly alternatives seem closer now than when I got my personal MacBook, and I'm still excited for them). This kind of thing seems like a positive change that lets me feel less conflicted.

Anyway, success here could perhaps be part of a virtuous cycle of increasing community collaboration in the way Apple engages with open-source. I imagine a lot of developers, like me, would both personally benefit from this and respect Apple for it.

by spockzon 6/10/2025, 3:06 AM

At first I thought this sounded like a blend of the virtualisation framework with a firecracker style lightweight kernel.

This project had its own kernel, but it also seems to be able to use the firecracker one. I wonder what the advantages are. Even smaller? Making use of some apple silicon properties?

Has anyone tried it already and is it fast? Compared to podman on Linux or Docker Desktop for Mac?

by julikon 6/10/2025, 2:44 PM

Really curious how this improves the filesystem bridging situation (which with Docker Desktop was basically bouncing from "bad" to "worse" and back over the years). Or whether it changes it at all.

by sitoleon 6/10/2025, 12:47 AM

Has anyone tried turning on nested virt yet? Since the new container CLI spins each container in its own lightweight Linux VM via Virtualization.framework, I’m wondering whether the framework will pass the virtualization extensions through so we can modprobe kvm inside the guest.

Apple’s docs say nested virtualization is only available on M3-class Macs and newer (VZGenericPlatformConfiguration.isNestedVirtualizationSupported) developer.apple.com, but I don’t see an obvious flag in the container tooling to enable it. Would love to hear if anyone’s managed to get KVM (or even qemu-kvm) running inside one of these VMs.

by sho_hnon 6/9/2025, 11:16 PM

So both of the other big two desktop OSs now have official mechanisms to run Linux VMs to host Linux-native applications.

You can make some kind of argument from this that Linux has won; certainly the Linux syscall API is now perhaps the most ubiquitous application API.

by roberttodon 6/9/2025, 10:58 PM

I need to look into this a little more, but can anyone tell me if this could be used to bundle a Linux container into a MacOS app? I can think of a couple of places that might be useful, for example giving a GPT access to a Linux environment without it having access to run root CLI commands.

by paxyson 6/9/2025, 11:41 PM

Thinking more about this a bit, one immediate issue I see with adoption is that the idea of launching each container in its own VM to fully isolate it and give it its own IP, while neat, doesn't really translate to Linux or Windows. This means if you have a team of developers and a single one of them doesn't have a mac, your local dev model is already broken. So I can't see a way to easily replace Docker/Compose with this.

by SamuelAdamson 6/10/2025, 1:53 AM

I wonder if this will dramatically improve gaming on a Mac? Valve has been making games more reliable due to Steam Deck, and gaming on Linux is getting better every year.

Could games be run inside a virtual Linux environment, rather than Apple’s Metal or similar tool?

This would also help game developers - now they only need to build for Windows, Linux, and consoles.

by solomatovon 6/9/2025, 10:09 PM

Does anyone know whether they have optimized memory management, i.e. virt machine not consuming more RAM than required?

by jbverschooron 6/9/2025, 10:13 PM

In my opinion this is a step towards the Apple cloud hosting.

They have Xcode cloud.

The $4B contract with Amazon ends, and it’s highly profitable.

Build a container, deploy on Apple, perhaps with access to their CPU’s

by newman314on 6/9/2025, 9:13 PM

I wonder how this will affect apps like Orbstack

by pmarreckon 6/10/2025, 2:48 PM

So the x64 containers will run fine on Apple Silicon?

by qalmakkaon 6/10/2025, 9:30 AM

that's nice and all - but where are the native Darwin containers? Why is it ok for Apple to continue squeezing people with macOS CI jobs to keep buying stupid Mac Minis to put in racks only to avoid a mess? Just pull FreeBSD jails!

by outcoldmanon 6/9/2025, 9:32 PM

Not sure what exactly is happening, but feels very slow. Builds are taking way longer. Tried to run builder with -c and -m to add more CPU and memory.

by cedwson 6/10/2025, 3:25 AM

Forget Linux containers on Mac, as far as I’m concerned that’s already a solved problem. What about Mac containers? We still don’t have a way to run a macOS app with its own process namespace/filesystem in 2025. And with all this AI stuff, there’s a need to minimise blast radius of a rogue app more than ever.

by rfooon 6/9/2025, 9:17 PM

This does not support memory ballooning yet. But they have documented custom kernel support, so, goodbye OrbStack.

by filleokuson 6/9/2025, 10:10 PM

Looks cool! In the short demo [0] they mention "within a few hundred milliseconds" as VM boot time (I assume?). I wonder how much tweaking they had to do, because this is using the Virtualization.framework, which has been around a while and used by Docker dekstop / Colima / UTM (as an option).

I wonder what the memory overhead is, especially if running multiple containers - as that would spin up multiple VM's.

[0]: https://developer.apple.com/videos/play/wwdc2025/346 10:10 and forwards

by dangon 6/10/2025, 4:08 AM

Related ongoing threads:

Container: Apple's Linux-Container Runtime - https://news.ycombinator.com/item?id=44229239 - June 2025 (11 comments)

Apple announces Foundation Models and Containerization frameworks, etc - https://news.ycombinator.com/item?id=44226978 - June 2025 (345 comments)

(Normally we'd merge them but it seems there are significant if subtle differences)

by miovoidon 6/10/2025, 2:58 AM

I hope it will support nested virtualization.

by omeid2on 6/10/2025, 7:36 AM

This is really bad news for Linux on Desktop.

Many developers I know don't use MacOS mainly because they depend on containers and virtualisation is slow, but if Apple can pull off efficient virtualisation and good system integration (port mapping, volumes), then it will eat away at a large share of linux systems.

by samptonon 6/9/2025, 10:25 PM

Apple please expose GPU cores to the VMs.

by mustache_kimonoon 6/10/2025, 4:33 AM

This is great. Also about time, etc.

But is it also finally time to fix dtrace on MacOS[0]?

[0]: https://developer.apple.com/forums/thread/735939?answerId=76...

by mattclarkdotneton 6/10/2025, 3:26 AM

Spoiler alert: it’s not containers.

It’s some nice tooling wrapped around lightweight VMs, so basically WSL2

by m3kw9on 6/10/2025, 12:17 AM

I’m already running docker on macOS what’s the difference?

by joshdavhamon 6/9/2025, 10:53 PM

Will this likely have any implications for tools like ‘act’ for running local GitHub actions? I’ve had some trouble running act on apple silicon in the past.

by arianvanpon 6/10/2025, 9:23 PM

Them synthesizing an EXT4 file system from tarball layers instead of something like EROFS is so extremely odd. Really really strange design.

by sneakon 6/9/2025, 10:01 PM

Surprising to me that this uses swift CLI tools (free software) and make, not Xcode.

by fralixon 6/10/2025, 2:10 PM

And when native OCI macos container engine native ?!

by xmorseon 6/10/2025, 5:20 PM

Is this basically the same thing as Orbstack?

by peterpost2on 6/10/2025, 7:16 AM

Terrible name. Look like a neat product though!

by pmarreckon 6/10/2025, 2:50 PM

Prefer the Nix approach unless a container approach is absolutely necessary.

by sirjazon 6/10/2025, 6:46 PM

This is just wsl2 from Microsoft, albeit with an Apple spin

by jamie0on 6/9/2025, 9:59 PM

disappointing theres still no namespacing in darwin for macos containers. would be great to run xcodebuild in a container

by IshKebabon 6/9/2025, 9:43 PM

Getting worried about WSL I see!

by justinzollarson 6/9/2025, 9:45 PM

I'm excited to run Systemd on mac!

by throwaway1482on 6/10/2025, 3:05 PM

If they're going this way, why not just replace the macOS kernel (XNU) with Linux? They'll get so much more.

by tgmaon 6/10/2025, 3:57 AM

I'm glad this will kill the Docker Desktop clone business on Mac. Friend company got hit by using one of the free ones and got rug pulled by them.

by m463on 6/9/2025, 11:48 PM

I think this is purely a checkbox feature to compare against wsl. Otherwise apple just wouldn't get involved (not engineers, who would do lots of good things, but management that let this out)

by bdcravenson 6/9/2025, 11:16 PM

Cool, but until someone (Apple or otherwise) implements Docker Compose on top of this, it's unlikely to see much use.

by rvzon 6/9/2025, 9:13 PM

Requires an Apple Silicon Mac to run.

> You need an Apple silicon Mac to build and run Containerization.

> To build the Containerization package, your system needs either:

> macOS 15 or newer and Xcode 26 Beta

> macOS 26 Beta 1 or newer

Those on Intel Macs, this is your last chance to switch to Apple Silicon, (Sequoia was the second last)[0] as macOS Tahoe is the last version to support Intel Macs.

[0] https://news.ycombinator.com/item?id=41560423