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