Apple's container CLI adds 'machines': persistent Linux dev environments on macOS
Apple’s open-source container project now supports ‘container machines’ — persistent, lightweight Linux environments that run alongside macOS rather than the ephemeral, single-app containers developers are used to. Unlike a typical container modeled on one application, a machine boots the image’s full init system, so systemd services like PostgreSQL run the way they would on a real Linux box. Machines are built from standard OCI images; any image shipping /sbin/init works, and Apple documents a Dockerfile recipe for a systemd-enabled Ubuntu 24.04 base.
The headline feature is host integration. Each machine automatically maps the Mac user’s account and mounts the macOS home directory at the matching Linux path, so repositories and dotfiles are shared between both systems with no copy step. The intended workflow: edit in a macOS editor or IDE, compile and run inside Linux, then inspect the resulting artifacts with native Mac tooling — profilers, browsers, debuggers — since both sides see the same files. Developers can spin up one machine per target distro (Alpine, Ubuntu, Debian) while keeping an identical home environment across all of them.
The CLI mirrors familiar container ergonomics: create, run, ls, stop, rm, plus a set-default command and an ‘m’ alias for brevity. Resources are configurable (memory defaults to half the host’s), the home mount can be read-write, read-only, or disabled, and first-boot user provisioning can be replaced with a custom script baked into the image. It’s a direct play for territory held by WSL2-style workflows and tools like Lima and OrbStack — a sign Apple wants Linux-targeting development to feel first-class on the Mac.
Read the full article
Continue reading at Hacker News →This is an AI-generated summary. Read the original for the full story.