Blame containers.conf.5.md

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