systemd-nspawn is a lightweight Linux container technology that differs from Docker by using writable root filesystems rather than read-only images. Described as chroot on steroids, it enables isolation on VPS servers without full virtualization overhead.
The author highlights key use cases: running software with isolation where nested virtualization isn't available, sharing hardware like GPUs, avoiding virtualization overhead, direct host file access, and as a Docker alternative.
To create containers, place root filesystems under /var/lib/machines/[hostname]. For Debian systems, use debootstrap: sudo debootstrap --include=systemd,dbus,locales,bash-completion,curl bookworm /var/lib/machines/debian.
Source: Hacker News · Summarized by HeadlinesBriefing