As someone from the cloud native world, I’m so excited to see the open source release of a new containerization framework today! Super cool to see Swift being utilized for server-side and cloud native development!
For those of you who’ve always wanted to write Mac native Linux containers — check out container
For those of you who want to check out the Swift framework and contribute — check out containerization
Would love to hear what you all think about the releases!
Are there any plans to support BSD or other operating systems also, or is there anything linux-specific to this effort? I recently picked up my first Mac in two decades and am looking forward to using this or UTM.
A lot of containerization stuff is inherently Linux-specific. The way to run other operating systems with containers is to do something like running an emulator in your container and supplying a VM image -- I haven't looked too closely at this yet, but I think this is basically facilitating this process, especially given these are Linux containers running inside macOS.
But that doesn't necessarily mean one can supply an arbitrary image in a container and expect it to work here, for example, since most of this stuff is oriented for Linux; especially since the macOS Virtualization framework only seems to supports Linux kernel/initrd booting, which the BSDs don't use.
Not how this works, they're already spinning up a VM per container, ie the OS run in the container is not shared between containers. Sure, you usually have to resort to running a VM in the container for other more limited solutions, but I hope that won't be the case here, at least eventually.
Obviously these new containers are currently geared towards linux, but given the current effort by some Apple devs to get Swift on FreeBSD and the seeming ability to run many different OSs in the underlying Virtualization framework, I wondered if these containers might support BSD and other OSs next.
I definitely plan to try it on UTM for mac without invoking QEMU emulation, just wondering if I could with this new framework too.
What I'm saying is, if you had a disk image for a different OS and you were doing this on a Linux host, you could run qemu inside your container with a disk image. But I think what is happening here is that these are the equivalent of Linux KVM virtual machines being run here, except the acceleration is happening on xnu instead.
Ooh, neat. (For the record, this uses VZEFIBootLoader)
Yep, I'm agreeing with you that other container solutions are more tied to the host OS, so the only way to run alternative OS's in those containers is to run a VM inside the container.
But since this is in reality a VM solution, where the "container" seems to really just be about standardizing the VM image format somewhat, I hope we can have BSD containers too.
I'd love to run an OpenBSD container with this new container framework one day.
Now that there is official FreeBSD support, I hope support of FreeBSD OCI containers makes it into Containerization, and eventually, we end up with Containerization running with FreeBSD as one of its hosts. :-)
I don't really understand what the reason is using the container.
When I use docker container, I expect the code can deploy on different OS as long as docker supports the OS. But this containerization framework only can run on macos.
My understanding is that the containers that are used are OCI compliant, which means they can be hosted on Docker, Podman, this new Containerization framework, etc.
Apple Container is a Container Runtime means to run any 'Linux' container on macOS, just like Docker and Podman.
You don't build Docker container, you build image based on an OS (usually Linux) and that can be deploy on an OS with a compatible kernel (this is required as the container uses the host kernel).
An amd64 linux image cannot be deployed on anything but Linux host (which can be a Linux lightweight VM) capable of running AMD 64 software.
Moreover, images don't need Docker to run, they just need a container runtime (crun, runc, …).
Most images are deployed in container orchestrators like Kubernetes that do not use Docker at all.
Being able to build run an image on macOS is critical to write softwares that should be deployed as containers elsewhere, and that what this software is about.
“Being able to build run an image on macOS is critical to write softwares that should be deployed as containers elsewhere, and that what this software is about”
A containerized Linux application can run on any host that supports Linux containers. This library and tool enables a containerized Linux applications to run on macOS, which is not normally possible.
It would be more exact to say "an alternative way to run Linux container on macOS", as podman (via podman machine) and docker already let you do it.
This Framework provides a different approach though as it runs one lightweight VM per container, and as it is designed as a library, it can be use to create new tools to managed containers on macOS.
A lot of questions about how lightweight these separate linux VMs can be, whether 10 containers run 10 separate linux kernels with no sharing or if there is some underlying resource sharing going on.
@karenchu, maybe you could get one of the engineers like Crosby to discuss those tradeoffs here, for those of us who'd like an idea of how this works but aren't in the weeds like the Containerization engineers?