liveBook · Manning

Containers.conf

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

containers.conf is a configuration file format used to define default settings for Podman and related container tools.

containers.conf defines default behavior for Podman and related container engines. It customizes settings that would otherwise rely on built-in defaults, including namespaces, SELinux use, capabilities, resource limits, logging, runtimes, and environment variables. section 1.3.11 section 5.0

Podman loads configuration from layered locations:

  • Files merge together; individual fields override earlier values, while CONTAINERS_CONF forces one file and ignores the others. section 5.3

Set a default environment variable

Create $HOME/.config/containers/containers.conf.d/env.conf with [containers] and env=[ "foo=bar" ]. Subsequent containers inherit foo=bar; inspect the result with podman run --rm ubi8 printenv.

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

How deep it goes
Explains configuration locations, merging, tables, and a working environment-variable override, but defers exhaustive option reference.
Examples
Uses ubi8 printenv, a user drop-in file, and inspection of a container image's containers.conf.
What it assumes
Assumes familiarity with Podman containers and basic Linux configuration, while identifying rootful and rootless file locations.
What you can do after
Operate/configure Podman with layered defaults, custom environment variables, security settings, namespaces, runtimes, and network behavior.
How it connects
Connects Podman with rootless mode, Linux namespaces, SELinux, OCI runtimes, logging, networking, and remote connections.

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.