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.
