liveBook · Manning

Fork/exec model

As explained in Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more

The fork/exec model is a process-launching pattern in which a parent process forks a child and the child replaces its program image by executing another program.

The fork/exec model launches a program as a child of the process that requested it. A parent such as Bash forks a child, and that child executes the new program. Podman applies this Unix pattern to containers: Podman starts an OCI runtime, which launches the container as a direct descendant of the container engine. section 1.3.3

This design avoids a permanently running daemon between the user and the container. Docker uses a client, daemon, containerd, and OCI runtime chain; Podman instead lets the user-launched engine create the runtime and container processes directly. Shared filesystem storage and operating-system IPC let multiple engines cooperate without daemon-to-daemon communication, using filesystem locking when coordination is needed. section 1.3.3 section 11.1

Figure 1.9 Podman fork/exec architecture. The user launches Podman, which executes the OCI runtime, which then launches the container. The container is a direct descendant of Podman.

Trace the process ancestry from the user’s Podman command through the OCI runtime to the container. section 1.3.3

The process relationship has practical security and operations consequences:

  • Preserves the launching user’s Linux loginuid in the containerized process, allowing audit records to identify which user started the container. section 11.1.2
  • Differs from Docker’s daemon path, where containers descend from a system-started daemon and commonly receive loginuid 4294967295 instead of the initiating user’s value. section 11.1.2
  • Supports investigation with podman run, podman inspect, /proc/<pid>/loginuid, auditctl, and ausearch rather than treating process ownership as opaque. section 11.1.2

Check container process attribution

Run `podman run -d ubi8-micro sleep 20`, obtain the process ID with `podman inspect -l --format '{{ .State.Pid }}'`, and read `/proc/<pid>/loginuid`. The reported value matches the user’s loginuid, while the comparable Docker process reports 4294967295. section 11.1.2

How Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more covers it

How deep it goes
Explains parent-child process ancestry, daemon contrast, shared operating-system mechanisms, and audit effects through command-line demonstrations.
Examples
Uses Podman and Docker sleep containers, /proc loginuid inspection, auditctl watches, and ausearch output to demonstrate attribution and access decisions.
What it assumes
Assumes basic Unix process and shell knowledge while defining the parent-child launch relationship and connecting it to Podman.
What you can do after
Diagnose container process ancestry and audit attribution by inspecting PIDs, loginuid values, and Linux audit records.
How it connects
Connects Podman with Docker, containerd, OCI runtimes, Linux process ancestry, filesystem locking, IPC, and kernel auditing.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more. The section links point to the parts of the book it draws on.