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