liveBook · Manning

Chapter 6: Rootless containers

What you will learn in chapter 6 of Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more

The introduction explains why rootless Podman is valuable on shared systems and sets up a closer look at how it works and where it can cause problems.

After this chapter you will be able to

What it builds on

Section by section

Introduction

The introduction explains why rootless Podman is valuable on shared systems and sets up a closer look at how it works and where it can cause problems.

Key terms: rootless mode, root-running daemon, container escape, root access, privileged mode, unprivileged mode, rootless, container images

6.1 How does rootless Podman work?

This section sets up a clean rootless Podman example and identifies user-namespace setup as the first step to examine behind the scenes.

Key terms: rootless Podman, user namespace, podman rmi --all --force, quay.io/rhatdan/myimage, myapp, container registry

6.1.1 Images contain content owned by multiple user identifiers (UIDs)

This section explains how rootless Podman uses user and mount namespaces to handle images with multiple file owners while keeping container privileges separate from host root.

Key terms: UID, GID, discretionary access control (DAC), image layers, user namespace, podman unshare, /proc/self/uid_map, /proc/self/gid_map, /etc/subuid, /etc/subgid

6.2 Rootless Podman under the covers

This section explains how rootless Podman establishes and keeps a user’s namespaces available across container runs, and how to refresh them when subordinate ID settings change.

Key terms: /etc/subuid, /etc/subgid, UID/GID, user namespace, mount namespace, podman pause process, race conditions, sharing content, network namespace, podman system migrate

6.2.1 Pulling the image

This section traces how rootless Podman finds or pulls an image, stores its layers, and handles file ownership while unpacking them.

Key terms: local container storage, containers/image, manifest, layers, config, container registry, containers/storage, overlay mount point, storage layer, ~/.local/share/containers/storage

6.2.2 Creating a container

Podman records a new container, adds a writable layer above its image, and then moves on to network setup.

Key terms: containers/storage, internal database, container layer, read/write layer, image, overlayfs, native overlay mounts, rootless overlay, fuse-overlayfs, overlay

6.2.3 Setting up the network

This section explains how rootless Podman uses slirp4netns to give containers network access and publish ports without permission to create host network devices or change firewall rules.

Key terms: rootless Podman, network namespace, slirp4netns, CNI plugins, rootful containers, 8080:8080 port mapping, TAP device, TCP/IP stack, host network namespace, socket operation

6.2.4 Starting the container monitor: conmon

Podman starts conmon to monitor a container, launch its configured OCI runtime, and arrange cleanup when the container exits.

Key terms: conmon, container monitor, OCI runtime, crun, runc, podman container cleanup $CTRID

6.2.5 Launching the OCI runtime

This section explains how the OCI runtime starts a rootless container and hands monitoring of the running process to conmon.

Key terms: OCI runtime, OCI spec file, namespaces, cgroups v2, SELinux label, seccomp rules, rootfs, container process, OCI hook programs, PID 1

6.2.6 The containerized application runs until completion

This subsection traces what happens when a containerized application exits, from conmon’s response to container cleanup and optional removal.

Key terms: podman stop, SIGCHLD, conmon, exit code, STDOUT/STDERR, podman container cleanup $CTRID, slirp4netns, mount points, --rm, containers/storage

6.3 Summary

The section recaps why rootless containers are more secure and names the namespaces and processes Podman uses to run them.

Where this is used later

Concepts explained in this chapter

← Chapter 5: Customization and configuration files Chapter 7: Integration with systemd →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.