Browser Tabs as a Container Runtime: Meet tabc

A new browser tabs container runtime called tabc runs each Docker container in its own Chromium tab. Docker treats it as one more OCI runtime, so the –runtime tabc flag on a normal run command is all it takes, and the container comes up in under a second. A Mac needs neither a hypervisor nor a Linux VM.

The project comes from developer Farid Zakaria, who built it on top of unikernel, a project by Pooya Parsa that compiles the Linux kernel to WebAssembly.

Why Docker on a Mac needs a VM today

Containers depend on the Linux kernel, which leaves macOS developers running a hidden Linux VM underneath. Docker Desktop, Colima, OrbStack and Podman Machine each start one first, and Apple’s own tool gives every container a VM of its own.

Docker’s creator Solomon Hykes remarked in 2019 that WASM plus WASI, had they existed in 2008, would have made Docker unnecessary. Docker is still around, and WebAssembly mostly accelerates web applications.

A terminal. On Linux, docker run with the runtime set to tabc prints Linux aarch64 from an x86-64 host. On a Mac, tabc run alpine prints Linux aarch64, and a check for Docker, Colima, QEMU or Lima finds no VM running.
Image: Farid Zakaria’s Blog

How tabc works

Docker’s default runtime, runc, launches your program as an ordinary process on the host kernel. tabc gives each container a tab instead. Inside it sits a private Linux kernel built for WebAssembly, and the container’s code runs on top.

The host kernel is never involved. The only requirement is a browser.

Earlier attempts to run Linux in a browser, such as JSLinux in 2011, v86, WebVM and qemu-wasm, ran into limits like 32-bit only support, slow performance and incomplete hardware emulation. Unikernel changes the picture because only the container’s own code goes through an emulator. Everything else the kernel does runs at near native speed.

On Linux, Docker pulls the image and hands it to tabc. A Mac has no Docker daemon to do that, so tabc run pulls the image itself. Launching an interactive Alpine shell this way and checking the system type shows Linux on aarch64.

Isolation comes from the browser

With no Linux namespaces in play, Chromium’s sandbox does the isolating, and that sandbox has years of hard use behind it. For stricter separation each container can run in its own browser profile, so neither processes nor storage are shared.

Speed and memory cost

On a Ryzen 7 7840U laptop, fifteen runs of echo hi from an Alpine bundle took roughly 0.87 seconds from command to exit. Starting the browser eats most of it. The flags –open and –link reuse an already running browser and remove that cost.

Memory is the bigger cost. A container sitting idle takes about 540 MiB of the host’s RAM, spread across the guest tab, the main browser process and its helpers. For scale, Firecracker quotes under 5 MiB of overhead per microVM and a 125 ms boot.

The container’s own processes are still emulated, so heavy computation can lag. You can get a feel for it at trynix.dev, which runs more than 300,000 Nixpkgs packages in the browser using unikernel. An earlier tool, container2wasm, emulated the whole machine including the kernel, which made it heavier and slower than tabc.

Tabs you can open and compose

The browser stays hidden unless you ask. With –open, the container’s page appears in your default browser. The page is a pty, so the tab and the terminal that launched it talk to each other. A command like tabc run -it –open -p 8123:80 nginx:alpine sh serves nginx on localhost:8123, which you can visit in another tab.

Docker Compose works too. The one edit is the runtime key in the Compose file; networks and volumes carry on as before. Since macOS has no Docker daemon for Compose, tabc ships a lightweight one called tocker. Running tocker –dashboard compose up starts a web server and a Redis instance, each in its own pane of a dashboard page, reaching each other by service name.

How to try it and what to expect

You can run nix run github:fzakaria/tabc — run alpine echo hi on Linux or on an Apple Silicon Mac with any recent browser. On Linux the Nix package brings its own Chromium unless you pass –open.

The trade-offs are plain. You give up memory and some compute speed, and you gain Linux containers on a Mac without a VM. For interactive use and small services that’s an acceptable deal, and the idea that a browser tab can stand in for a container is now something you can test yourself. The project’s README covers setup and usage in more detail.

Source: Farid Zakaria’s Blog

Written by

Saksham Bhargava

Saksham Bhargava runs Alteroid and has been writing about consumer technology for over five years, covering iPhone, Android, Windows, AI tools and gaming. With an MCA and six years of hands-on web development experience, he tests the features he writes about on his own devices and focuses on clear, practical guides that solve real problems. Away from the screen, he enjoys travelling to places most tourists skip.