Identity and needs
The identity across the boundary
The process inside the container runs as the account that owns the instance's sockets. The Core translates that requirement per engine and per mode; a description never states it.
| Engine and mode | The Core asks for |
|---|---|
| Podman, rootless | the identity kept (keep-id), and no user |
| Docker, rootless | user 0:0, which the engine maps to the launching account |
| either, running as root | the launching account's user and group, by number |
- Supplementary groups are looked up by name on the host and carried as the numbers that lookup returned. A group carried across by number alone could land on a different group inside the image.
- Anything mounted is created on the host first, with its ownership set. A path the engine had to
create would belong to
root.
What each need expands into
A need is expanded at every launch, from the Core's environment and the host's filesystem as they are
then. A need that cannot be expanded fails that launch, naming the need; the unit is Failed and the
restart policy decides what follows.
| Need | On the host | In a container, also |
|---|---|---|
device:<name> | the bound path must exist; the unit is handed it through ${bind.<name>} | the device mapped at the same path; its owning group added where it is the account's way in — the account is in it, and the node does not let every account use it already — by number on an engine running as root, the account's own groups kept on rootless Podman, none on rootless Docker |
storage:<name> | the directory <state>/storage/<name>, created mode 0700 if absent; handed through ${bind.<name>} | the directory mounted at the same path |
display | WAYLAND_DISPLAY, as the socket's absolute path, and XDG_RUNTIME_DIR; DISPLAY and XAUTHORITY for X11 | each socket and the authority file mounted at the same path; no XDG_RUNTIME_DIR |
audio | PIPEWIRE_REMOTE and PULSE_SERVER=unix:<path>, for whichever socket exists | each socket mounted at the same path |
network | nothing | the engine's default network, in place of none |
- A device is the only class a description binds. A directory and a secret are given by the
runtime; a display, an audio path and a network are the host's own. A
bindentry naming any of them is refused. - A display is found from
WAYLAND_DISPLAY— a name underXDG_RUNTIME_DIR, or an absolute path — and fromDISPLAYof the form:<n>, whose socket is/tmp/.X11-unix/X<n>. Neither present is a failed launch. - Audio is PipeWire's socket (
PIPEWIRE_REMOTE, orpipewire-0underXDG_RUNTIME_DIR) and PulseAudio's (PULSE_SERVER=unix:<path>, orpulse/nativeunderXDG_RUNTIME_DIR). Neither present is a failed launch. - On rootless Podman the account's groups are kept through the runtime: crun honours it, runc does not, and under runc a device reachable only through a group is not reachable from the container.
The set of classes is closed. A need it cannot express is answered by running the unit on the host.