Configure unified configuration

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.

Before you begin

  • 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 all non-root user:
    1. Create the /etc/containers/containers.rootless.conf.d/ directory to set it for all non root users.
      $ mkdir /etc/containers/containers.rootless.conf.d/
    2. Create the /etc/containers/containers.rootless.conf.d/dns.conf configuration 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:
    1. 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/
    2. Create the dns.conf configuration file, for example, to set a dns server in the /etc/containers/containers.rootless.conf.d/4242740/dns.conf directory:
      [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.