Skip to content

layer-nerdctl

Recipe card from the charly-distros plugin (Images — the deployable catalog).

nerdctl (the containerd CLI) plus the rootless containerd + buildkit + CNI stack, as ONE candy. Composed by a box that wants the opt-in engine: containerd engine.

  • Native packages on Arch/CachyOS/Omarchy and Alpine: nerdctl, containerd, cni-plugins, rootlesskit, slirp4netns, buildkit, fuse-overlayfs, crun, iptables-nft (arch) / iptables (alpine), plus shadow (newuidmap/newgidmap) and dbus (the user dbus.socket).
  • Non-native distros (Fedora/Debian/Ubuntu) install the pinned, fatally sha256-verified nerdctl-full tarball (step nerdctl-full-tarball), which supplies nerdctl + containerd + containerd-fuse-overlayfs-grpc + CNI + buildkit + rootlesskit in one archive. The helpers come from shadow-utils (Fedora) or uidmap (Debian/Ubuntu); the user bus from dbus-daemon or dbus-user-session.
  • /etc/nerdctl/nerdctl.toml with namespace = "default" (the ONE spelling the programme uses) and cni_path = "/opt/cni/bin". The BuildKit socket is deliberately NOT pinned: it is a runtime value resolved through the ONE roots resolver ($XDG_RUNTIME_DIR/charly/buildkitd.sock).
  • The charly CNI network conflist at /etc/cni/net.d/charly.conflist, and the CNI plugins at the ONE cni_path the toml declares (/opt/cni/bin): Arch’s package installs there, the nerdctl-full tarball extracts to /usr/local/libexec/cni, and a step links every real plugin to the declared path (no per-distro cni_path).
  • The rootless containerd and buildkit user units (~/.config/systemd/user/{containerd,buildkit}.service), written from the upstream setuptool templates. ExecStart goes through /usr/bin/env so one unit works for both the /usr/local/bin (tarball) and /usr/bin (package) install locations.
  • The nested-pod posture: userns-scoped cap_add: ALL, /dev/fuse, /dev/net/tun, unmask=/proc/*.

The rootless checklist (CONTAINERD.md §2 and §4)

Section titled “The rootless checklist (CONTAINERD.md §2 and §4)”

Every item below is a real plan step with a check:; the runtime half is asserted by the check-nerdctl-rootless disposable-VM bed.

Item Where Why it exists
newuidmap / newgidmap distro packages (shadow, uidmap, shadow-utils) rootlesskit execs them to write the UID/GID map; the setuptool checks only the binaries it installs, never these two
user:100000:65536 in /etc/subuid and /etc/subgid plan step rootless-subuid the ranges the helpers consume
user@.service.d/delegate.conf with Delegate=cpu cpuset io memory pids plan step rootless-delegate-controllers memory/cpuset/io limits and --cpuset-cpus; a new login picks it up
linger bed, PERFORM (loginctl enable-linger) the user manager and its units must outlive the login session
/dev/fuse bed, PRESENCE (opens the node) the fuse-overlayfs fallback is a libfuse3 client; the setuptool checks the binaries and never the node
user D-Bus (dbus-user-session / dbus-daemon / dbus) package + bed (dbus.socket) the rootless unit has Requires=dbus.socket
slirp4netns as the network driver the containerd unit sets CONTAINERD_ROOTLESS_ROOTLESSKIT_NET=slirp4netns the documented default
the setuptool run bed, PERFORM (install + install-buildkit) starts and enables the written units
namespace = "default" nerdctl.toml one namespace spelling, no per-layer name
  • slirp4netns is the default and is pinned in the unit.
  • pasta is an option, not a recommendation. Measured on rootlesskit 3.3.0 with pasta 2026_10_02.cba3570: rootlesskit --net=pasta true returns rc 0. The deployment’s networking properties (published ports bind 0.0.0.0, container→host loopback is blocked, no ephemeral host port) are measured on slirp4netns, so pasta is not recommended.
  • bypass4netns is an option only where rootlesskit serves it. The setuptool can install bypass4netnsd, and nerdctl annotates a container with nerdctl/bypass4netns=true. Measured on rootlesskit 3.3.0, both --net=bypass4netns and --port-driver=bypass4netns are refused (unknown network mode / unknown port driver), so this layer does not set it.

Low ports — a documented option, never forced

Section titled “Low ports — a documented option, never forced”

Do not lower net.ipv4.ip_unprivileged_port_start for this layer. A rootless publish of a port below 1024 fails bind: permission denied until the host lowers it; the container-side threshold is the CNI netns’s own 0, so a process inside a rootless lease binds a low port with no sysctl at all. If a specific deploy needs the publish side, set it deliberately in /etc/sysctl.d/ on that host — never here, and never as a blanket default.

The engine: containerd word is served by opencharly/plugin-nerdctl (out-of-process) or compiled in; every engine op delegates to container.InvokeEngineOp("containerd", …) in the spec module. containerd is the engine WORD; nerdctl is the CLI BINARY that drives it — the spec-owned #EngineBinaries map (containerd → nerdctl) is the one home for that mapping. nerdctl has no --keep-id, so the start-plan runs the workload as --user 0:0 (uid 0 == the host user under rootless), guaranteeing uid-identical sharing; a non-zero uid needs the subuid caveat.

  • The candy’s check: steps prove the static half on every distro arm: the helpers, the subuid ranges, the delegation drop-in, D-Bus, slirp4netns, the written units (marker + systemd-analyze --user verify), namespace = "default", and a negative test that the checksum verifier rejects a corrupted archive.
  • check-nerdctl-rootless (root charly.yml, disposable VM) is the runtime gate: ABSENCE (no rootless daemon) → PERFORM (daemon-reload, linger, the setuptool) → PRESENCE (nerdctl info reports name=rootless, the helpers resolve, /dev/fuse opens, the units are active). It records the rootful system socket’s inode/mtime before the daemon starts and asserts it is unchanged after, and that the rootless daemon listens on the user socket.

Working with the containerd engine (driven through the nerdctl CLI), the layer-nerdctl candy, the rootless containerd/buildkit checklist, or an engine: containerd deploy.