Chapter 18. Configuring unified configuration for rootless podman
You can enable centralized policy management and operational standardization across all rootless users of podman by using a unified system-wide configuration files. You can inherit defaults without manual configuration while maintaining the flexibility to override system defaults through personal configuration files.
18.1. Overview of unified configuration for rootless Podman Copy linkLink copied to clipboard!
By default, the containers.conf rootless was reading /etc/containers/containers.conf for global configuration affecting all users. It lacked a centralized way to set default configurations for rootless Podman across all users on a system without affecting the rootful podman process.
For global configuration that only affects rootless users, use the /etc/containers/containers.rootless.d/*.conf and /etc/containers/containers.rootless.d/$UID/*.conf.
Unified configuration is primarily managed through a set of modular, hierarchical configuration files. The key features and benefits of unified configuration are:
- For System Administrators: You can set organization-wide defaults for rootless containers, establish consistent configurations across all the users and achieve operational standardization by enforcing common resource limits, registry settings, and runtine behaviors.
- For End Users: You inherit defaults without manual configuration, override system defaults through personal configuration files, and achieve backward compatibility because you donot need to change existing user workflows or configurations.
Previously, a centralized way was lacked for System administrators to set default configurations for rootless Podman across all users on a system without affecting the rootful podman process.
18.2. Configuring unified configuration Copy linkLink copied to clipboard!
To configure a unified setup for rootless Podman on RHEL, you must primarily manage system-wide settings for prerequisites, while allowing users to override specific configurations in their home directories.
Prerequisites
- You have installed Podman.
- You have verified whether your rootless configuration is set up.
Procedure
You can configure the unified configuration in two available methods:
You can configure the setting for a all non-root user:
Create the
/etc/containers/containers.rootless.conf.d/directory to set it for all non root users.$ mkdir /etc/containers/containers.rootless.conf.d/Create the
/etc/containers/containers.rootless.conf.d/dns.confconfiguration file, for example, to set a dns server:[containers] dns_servers = [ "1.1.1.1", "8.8.8.8", ]
You can configure the setting for a specified non-root user:
Create the
/etc/containers/containers.rootless.conf.d/UID/directory to set it for a particular non root user.$ mkdir /etc/containers/containers.rootless.conf.d/UID/Create the
dns.confconfiguration file, for example, to set a dns server in the/etc/containers/containers.rootless.conf.d/4242740/dns.confdirectory:[containers] dns_servers = [ "1.1.1.1", "8.8.8.8", ]Place the configuration file in the directory named after the user’s UID. This way, podman knows which user to apply the setting for.