20884f
% containers.conf(5) Container engine configuration file
20884f
20884f
# NAME
20884f
containers.conf - The container engine configuration file specifies default
20884f
configuration options and command-line flags for container engines.
20884f
20884f
# DESCRIPTION
20884f
Container engines like Podman & Buildah read containers.conf file, if it exists
20884f
and modify the defaults for running containers on the host. containers.conf uses
20884f
a TOML format that can be easily modified and versioned.
20884f
20884f
Container engines read the /usr/share/containers/containers.conf and
20884f
/etc/containers/containers.conf files if they exists.  When running in rootless
20884f
mode, they also read $HOME/.config/containers/containers.conf files.
20884f
20884f
Fields specified in containers conf override the default options, as well as
20884f
options in previously read containers.conf files.
20884f
20884f
Not all options are supported in all container engines.
20884f
20884f
Note container engines also use other configuration files for configuring the environment.
20884f
20884f
* `storage.conf` for configuration of container and images storage.
20884f
* `registries.conf` for definition of container registires to search while pulling.
20884f
container images.
20884f
* `policy.conf` for controlling which images can be pulled to the system.
20884f
20884f
# FORMAT
20884f
The [TOML format][toml] is used as the encoding of the configuration file.
20884f
Every option is nested under its table. No bare options are used. The format of
20884f
TOML can be simplified to:
20884f
20884f
    [table1]
20884f
    option = value
20884f
20884f
    [table2]
20884f
    option = value
20884f
20884f
    [table3]
20884f
    option = value
20884f
20884f
    [table3.subtable1]
20884f
    option = value
20884f
20884f
## CONTAINERS TABLE
20884f
The containers table contains settings pertaining to the OCI runtime that can
20884f
configure and manage the OCI runtime.
20884f
20884f
**devices**=[]
20884f
20884f
List of devices.
20884f
Specified as 'device-on-host:device-on-container:permissions'.
20884f
20884f
Example: "/dev/sdc:/dev/xvdc:rwm".
20884f
20884f
**volumes**=[]
20884f
20884f
List of volumes.
20884f
Specified as "directory-on-host:directory-in-container:options".
20884f
20884f
Example:  "/db:/var/lib/db:ro".
20884f
20884f
**apparmor_profile**="container-default"
20884f
20884f
Used to change the name of the default AppArmor profile of container engines.
20884f
The default profile name is "container-default".
20884f
20884f
**cgroupns**="private"
20884f
20884f
Default way to to create a cgroup namespace for the container.
20884f
Options are:
20884f
`private` Create private Cgroup Namespace for the container.
20884f
`host`    Share host Cgroup Namespace with the container.
20884f
20884f
**cgroups**="enabled"
20884f
20884f
Determines  whether  the  container will create CGroups.
20884f
Options are:
20884f
  `enabled`   Enable cgroup support within container
20884f
  `disabled`  Disable cgroup support, will inherit cgroups from parent
20884f
  `no-conmon` Do not create a cgroup dedicated to conmon.
20884f
20884f
**default_capabilities**=[]
20884f
20884f
List of default capabilities for containers.
20884f
20884f
The default list is:
20884f
```
20884f
default_capabilities = [
20884f
"AUDIT_WRITE",
20884f
      "CHOWN",
20884f
      "DAC_OVERRIDE",
20884f
      "FOWNER",
20884f
      "FSETID",
20884f
      "KILL",
20884f
      "MKNOD",
20884f
      "NET_BIND_SERVICE",
20884f
      "NET_RAW",
20884f
      "SETGID",
20884f
      "SETPCAP",
20884f
      "SETUID",
20884f
      "SYS_CHROOT",
20884f
]
20884f
```
20884f
20884f
**default_sysctls**=[]
20884f
20884f
A list of sysctls to be set in containers by default,
20884f
specified as "name=value".
20884f
20884f
Example:"net.ipv4.ping_group_range=0 1000".
20884f
20884f
**default_ulimits**=[]
20884f
20884f
A list of ulimits to be set in containers by default,
20884f
specified as "name=soft-limit:hard-limit".
20884f
20884f
Example: "nofile=1024:2048".
20884f
20884f
**dns_options**=[]
20884f
20884f
List of default DNS options to be added to /etc/resolv.conf inside of the
20884f
container.
20884f
20884f
**dns_searches**=[]
20884f
20884f
List of default DNS search domains to be added to /etc/resolv.conf inside of
20884f
the container.
20884f
20884f
**dns_servers**=[]
20884f
20884f
A list of dns servers to override the DNS configuration passed to the
20884f
container. The special value “none” can be specified to disable creation of
20884f
/etc/resolv.conf in the container.
20884f
20884f
**env**=["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "TERM=xterm"]
20884f
20884f
Environment variable list for the container process, used for passing
20884f
environment variables to the container.
20884f
20884f
**env_host**=false
20884f
20884f
Pass all host environment variables into the container.
20884f
20884f
**http_proxy**=true
20884f
20884f
Default proxy environment variables will be passed into the container.
20884f
The environment variables passed in include:
20884f
`http_proxy`, `https_proxy`, `ftp_proxy`, `no_proxy`, and the upper case
20884f
versions of these. The `no_proxy` option is needed when host system uses a proxy
20884f
but container should not use proxy. Proxy environment variables specified for
20884f
the container in any other way will override the values passed from the host.
20884f
20884f
**init**=false
20884f
20884f
Run an init inside the container that forwards signals and reaps processes.
20884f
20884f
**init_path**="/usr/libexec/podman/catatonit"
20884f
20884f
Path to the container-init binary, which forwards signals and reaps processes
20884f
within containers.  Note that the container-init binary will only be used when
20884f
the `--init` for podman-create and podman-run is set.
20884f
20884f
**ipcns**="private"
20884f
20884f
Default way to to create a IPC namespace for the container.
20884f
Options are:
20884f
  `private` Create private IPC Namespace for the container.
20884f
  `host`    Share host IPC Namespace with the container.
20884f
20884f
**keyring**=true
20884f
20884f
Indicates whether the container engines create a kernel keyring for use within
20884f
the container.
20884f
20884f
**label**=true
20884f
20884f
Indicates whether the container engine uses MAC(SELinux) container separation via labeling. This option is ignored on disabled systems.
20884f
20884f
**log_driver**="k8s-file"
20884f
20884f
Logging driver for the container. Available options: `k8s-file` and `journald`.
20884f
20884f
**log_size_max**=-1
20884f
20884f
Maximum size allowed for the container's log file. Negative numbers indicate
20884f
that no size limit is imposed. If it is positive, it must be >= 8192 to
20884f
match/exceed conmon's read buffer. The file is truncated and re-opened so the
20884f
limit is never exceeded.
20884f
20884f
**netns**="private"
20884f
20884f
Default way to to create a NET namespace for the container.
20884f
Options are:
20884f
  `private` Create private NET Namespace for the container.
20884f
  `host`    Share host NET Namespace with the container.
20884f
  `none`    Containers do not use the network.
20884f
20884f
**no_hosts**=false
20884f
20884f
Create /etc/hosts for the container.  By default, container engines manage
20884f
/etc/hosts, automatically adding  the container's  own  IP  address.
20884f
20884f
**pids_limit**=1024
20884f
20884f
Maximum number of processes allowed in a container. 0 indicates that no limit
20884f
is imposed.
20884f
20884f
**pidns**="private"
20884f
20884f
Default way to to create a PID namespace for the container.
20884f
Options are:
20884f
  `private` Create private PID Namespace for the container.
20884f
  `host`    Share host PID Namespace with the container.
20884f
20884f
**seccomp_profile**="/usr/share/containers/seccomp.json"
20884f
20884f
Path to the seccomp.json profile which is used as the default seccomp profile
20884f
for the runtime.
20884f
20884f
**shm_size**="65536k"
20884f
20884f
Size of `/dev/shm`. The format is `<number><unit>`. `number` must be greater
20884f
than `0`.
20884f
Unit is optional and can be:
20884f
`b` (bytes), `k` (kilobytes), `m`(megabytes), or `g` (gigabytes).
20884f
If you omit the unit, the system uses bytes. If you omit the size entirely,
20884f
the system uses `65536k`.
20884f
20884f
**tz=**""
20884f
20884f
Set timezone in container. Takes IANA timezones as well as `local`, which sets the timezone in the container to match the host machine.
20884f
If not set, then containers will run with the time zone specified in the image.
20884f
20884f
Examples:
20884f
  `tz="local"`
20884f
  `tz="America/New_York"`
20884f
20884f
**umask**="0022"
20884f
20884f
Sets umask inside the container.
20884f
20884f
**utsns**="private"
20884f
20884f
Default way to to create a UTS namespace for the container.
20884f
Options are:
20884f
  `private` Create private UTS Namespace for the container.
20884f
  `host`    Share host UTS Namespace with the container.
20884f
20884f
**userns**="host"
20884f
20884f
Default way to to create a USER namespace for the container.
20884f
Options are:
20884f
  `private` Create private USER Namespace for the container.
20884f
  `host`    Share host USER Namespace with the container.
20884f
20884f
**userns_size**=65536
20884f
20884f
Number of UIDs to allocate for the automatic container creation. UIDs are
20884f
allocated from the “container” UIDs listed in /etc/subuid & /etc/subgid.
20884f
20884f
## NETWORK TABLE
20884f
The `network` table contains settings pertaining to the management of CNI
20884f
plugins.
20884f
20884f
**cni_plugin_dirs**=["/opt/cni/bin/",]
20884f
20884f
List of paths to directories where CNI plugin binaries are located.
20884f
20884f
**default_network**="podman"
20884f
20884f
The network name of the default CNI network to attach pods to.
20884f
20884f
**network_config_dir**="/etc/cni/net.d/"
20884f
20884f
Path to the directory where CNI configuration files are located.
20884f
20884f
## ENGINE TABLE
20884f
The `engine` table contains configuration options used to set up container engines such as Podman and Buildah.
20884f
20884f
**image_build_format**="oci"
20884f
The default image format to building container images. Valid values are "oci" (default) or "docker".
20884f
20884f
**cgroup_check**=false
20884f
20884f
CgroupCheck indicates the configuration has been rewritten after an upgrade to Fedora 31 to change the default OCI runtime for cgroupsv2.
20884f
20884f
**cgroup_manager**="systemd"
20884f
20884f
The cgroup management implementation used for the runtime. Supports `cgroupfs`
20884f
and `systemd`.
20884f
20884f
**conmon_env_vars**=[]
20884f
20884f
Environment variables to pass into Conmon.
20884f
20884f
**conmon_path**=[]
20884f
20884f
Paths to search for the conmon container manager binary. If the paths are
20884f
empty or no valid path was found, then the `$PATH` environment variable will be
20884f
used as the fallback.
20884f
20884f
The default list is:
20884f
```
20884f
conmon_path=[
20884f
    "/usr/libexec/podman/conmon",
20884f
    "/usr/local/libexec/podman/conmon",
20884f
    "/usr/local/lib/podman/conmon",
20884f
    "/usr/bin/conmon",
20884f
    "/usr/sbin/conmon",
20884f
    "/usr/local/bin/conmon",
20884f
    "/usr/local/sbin/conmon",
20884f
    "/run/current-system/sw/bin/conmon",
20884f
]
20884f
```
20884f
20884f
**detach_keys**="ctrl-p,ctrl-q"
20884f
20884f
Keys sequence used for detaching a container.
20884f
Specify the keys sequence used to detach a container.
20884f
Format is a single character `[a-Z]` or a comma separated sequence of
20884f
`ctrl-<value>`, where `<value>` is one of:
20884f
`a-z`, `@`, `^`, `[`, `\`, `]`, `^` or `_`
20884f
20884f
**enable_port_reservation**=true
20884f
20884f
Determines whether the engine will reserve ports on the host when they are
20884f
forwarded to containers. When enabled, when ports are forwarded to containers,
20884f
they are held open by conmon as long as the container is running, ensuring that
20884f
they cannot be reused by other programs on the host. However, this can cause
20884f
significant memory usage if a container has many ports forwarded to it.
20884f
Disabling this can save memory.
20884f
20884f
**env**=[]
20884f
20884f
Environment variables to be used when running the container engine (e.g., Podman, Buildah).  For example "http_proxy=internal.proxy.company.com".
20884f
Note these environment variables will not be used within the container. Set the env section under [containers] table,
20884f
if you want to set environment variables for the container.
20884f
20884f
**events_logger**="journald"
20884f
20884f
Default method to use when logging events.
20884f
Valid values: `file`, `journald`, and `none`.
20884f
20884f
**hooks_dir**=["/etc/containers/oci/hooks.d", ...]
20884f
20884f
Path to the OCI hooks directories for automatically executed hooks.
20884f
20884f
**image_default_transport**="docker://"
20884f
20884f
Default transport method for pulling and pushing images.
20884f
20884f
**infra_command**="/pause"
20884f
20884f
Command to run the infra container.
20884f
20884f
**infra_image**="k8s.gcr.io/pause:3.2"
20884f
20884f
Infra (pause) container image name for pod infra containers.  When running a
20884f
pod, we start a `pause` process in a container to hold open the namespaces
20884f
associated with the  pod.  This container does nothing other then sleep,
20884f
reserving the pods resources for the lifetime of the pod.
20884f
20884f
**lock_type**="shm"
20884f
20884f
Specify the locking mechanism to use; valid values are "shm" and "file".
20884f
Change the default only if you are sure of what you are doing, in general
20884f
"file" is useful only on platforms where cgo is not available for using the
20884f
faster "shm" lock type.  You may need to run "podman system renumber" after you
20884f
change the lock type.
20884f
20884f
**multi_image_archive**=false
20884f
20884f
Allows for creating archives (e.g., tarballs) with more than one image.  Some container engines, such as Podman, interpret additional arguments as tags for one image and hence do not store more than one image.  The default behavior can be altered with this option.
20884f
20884f
**namespace**=""
20884f
20884f
Default engine namespace. If the engine is joined to a namespace, it will see
20884f
only containers and pods that were created in the same namespace, and will
20884f
create new containers and pods in that namespace.  The default namespace is "",
20884f
which corresponds to no namespace. When no namespace is set, all containers
20884f
and pods are visible.
20884f
20884f
**network_cmd_path**=""
20884f
20884f
Path to the slirp4netns binary.
20884f
20884f
**network_cmd_options**=[]
20884f
20884f
Default options to pass to the slirp4netns binary.
20884f
20884f
Example "allow_host_loopback=true"
20884f
20884f
**no_pivot_root**=false
20884f
20884f
Whether to use chroot instead of pivot_root in the runtime.
20884f
20884f
**num_locks**=2048
20884f
20884f
Number of locks available for containers and pods. Each created container or
20884f
pod consumes one lock.  The default number available is 2048.  If this is
20884f
changed, a lock renumbering must be performed, using the
20884f
`podman system renumber` command.
20884f
20884f
**active_service**=""
20884f
20884f
Name of destination for accessing the Podman service.
20884f
20884f
**[service_destinations]**
20884f
20884f
**[service_destinations.{name}]**
20884f
20884f
**uri="ssh://user@production.example.com/run/user/1001/podman/podman.sock"**
20884f
20884f
  Example URIs:
20884f
20884f
- **rootless local**  - unix://run/user/1000/podman/podman.sock
20884f
- **rootless remote** - ssh://user@engineering.lab.company.com/run/user/1000/podman/podman.sock
20884f
- **rootfull local**  - unix://run/podman/podman.sock
20884f
- **rootfull remote** - ssh://root@10.10.1.136:22/run/podman/podman.sock
20884f
20884f
**identity="~/.ssh/id_rsa**
20884f
20884f
Path to file containing ssh identity key
20884f
20884f
**pull_policy**="always"|"missing"|"never"
20884f
20884f
Pull image before running or creating a container. The default is **missing**.
20884f
20884f
- **missing**: attempt to pull the latest image from the registries listed in registries.conf if a local image does not exist. Raise an error if the image is not in any listed registry and is not present locally.
20884f
- **always**: pull the image from the first registry it is found in as listed in registries.conf. Raise an error if not found in the registries, even if the image is present locally.
20884f
- **never**: do not pull the image from the registry, use only the local version. Raise an error if the image is not present locally.
20884f
20884f
**remote** = false
20884f
Indicates whether the application should be running in remote mode. This flag modifies the
20884f
--remote option on container engines. Setting the flag to true will default `podman --remote=true` for access to the remote Podman service.
20884f
20884f
**runtime**=""
20884f
20884f
Default OCI specific runtime in runtimes that will be used by default. Must
20884f
refer to a member of the runtimes table. Default runtime will be searched for
20884f
on the system using the priority: "crun", "runc", "kata".
20884f
20884f
**runtime_supports_json**=["crun", "runc", "kata"]
20884f
20884f
The list of the OCI runtimes that support `--format=json`.
20884f
20884f
**runtime_supports_nocgroups**=["crun"]
20884f
20884f
The list of OCI runtimes that support running containers without CGroups.
20884f
20884f
**runtime_supports_kvm**=["kata"]
20884f
20884f
The list of OCI runtimes that support running containers with KVM separation.
20884f
20884f
**static_dir**="/var/lib/containers/storage/libpod"
20884f
20884f
Directory for persistent libpod files (database, etc).
20884f
By default this will be configured relative to where containers/storage
20884f
stores containers.
20884f
20884f
**stop_timeout**=10
20884f
20884f
Number of seconds to wait for container to exit before sending kill signal.
20884f
20884f
**tmp_dir**="/run/libpod"
20884f
20884f
The path to a temporary directory to store per-boot container.
20884f
Must be a tmpfs (wiped after reboot).
20884f
20884f
**volume_path**="/var/lib/containers/storage/volumes"
20884f
20884f
Directory where named volumes will be created in using the default volume
20884f
driver.
20884f
By default this will be configured relative to where containers/storage store
20884f
containers. This convention is followed by the default volume driver, but may
20884f
not be by other drivers.
20884f
20884f
**[engine.volume_plugins]**
20884f
20884f
A table of all the enabled volume plugins on the system. Volume plugins can be
20884f
used as the backend for Podman named volumes. Individual plugins are specified
20884f
below, as a map of the plugin name (what the plugin will be called) to its path
20884f
(filepath of the plugin's unix socket).
20884f
20884f
# FILES
20884f
20884f
**containers.conf**
20884f
20884f
Distributions often provide a `/usr/share/containers/containers.conf` file to
20884f
define default container configuration. Administrators can override fields in
20884f
this file by creating `/etc/containers/containers.conf` to specify their own
20884f
configuration. Rootless users can further override fields in the config by
20884f
creating a config file stored in the
20884f
`$HOME/.config/containers/containers.conf` file.
20884f
20884f
If the `CONTAINERS_CONF` path environment variable is set, just
20884f
this path will be used.  This is primarily used for testing.
20884f
20884f
Fields specified in the containers.conf file override the default options, as
20884f
well as options in previously read containers.conf files.
20884f
20884f
**storage.conf**
20884f
20884f
The `/etc/containers/storage.conf` file is the default storage configuration file.
20884f
Rootless users can override fields in the storage config by creating
20884f
`$HOME/.config/containers/storage.conf`.
20884f
20884f
If the `CONTAINERS_STORAGE_CONF` path environment variable is set, this path
20884f
is used for the storage.conf file rather than the default.
20884f
This is primarily used for testing.
20884f
20884f
# SEE ALSO
20884f
containers-storage.conf(5), containers-policy.json(5), containers-registries.conf(5)
20884f
20884f
[toml]: https://github.com/toml-lang/toml