Build in a systemd-nspawn container
· 3 min read
For general information about systemd-nspawn, see:
systemd-nspawn(1)andsystemd.nspawn(5)manpages- Archlinux wiki
The container is a directory under /var/lib/machines that systemd boots. One
file controls it: the nspawn config (/etc/systemd/nspawn/<name>.nspawn).
Why build in a systemd-nspawn container?
This guide is for cross-building (e.g. Yocto) against an old distribution without touching the host. systemd-nspawn gives you:
- an old distribution, in a chroot that systemd manages for you
- fine control over resources such as CPUs and memory
- easy access to the journal from the host
- nothing more than systemd to install