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
f9b602
**annotations** = []
f9b602
List of annotations. Specified as "key=value" pairs to be added to all containers.
85cf5c
f9b602
Example: "run.oci.keep_original_groups=1"
2d4258
2d4258
**apparmor_profile**="container-default"
85cf5c
85cf5c
Used to change the name of the default AppArmor profile of container engines.
2d4258
The default profile name is "container-default".
2d4258
2d4258
**cgroups**="enabled"
85cf5c
85cf5c
Determines  whether  the  container will create CGroups.
85cf5c
Options are:
85cf5c
  `enabled`   Enable cgroup support within container
85cf5c
  `disabled`  Disable cgroup support, will inherit cgroups from parent
379816
  `no-conmon` Do not create a cgroup dedicated to conmon.
2d4258
f9b602
**cgroupns**="private"
f9b602
f9b602
Default way to to create a cgroup namespace for the container.
f9b602
Options are:
f9b602
`private` Create private Cgroup Namespace for the container.
f9b602
`host`    Share host Cgroup Namespace with the container.
f9b602
2d4258
**default_capabilities**=[]
2d4258
85cf5c
List of default capabilities for containers.
85cf5c
85cf5c
The default list is:
2d4258
```
85cf5c
default_capabilities = [
85cf5c
"AUDIT_WRITE",
85cf5c
      "CHOWN",
85cf5c
      "DAC_OVERRIDE",
85cf5c
      "FOWNER",
85cf5c
      "FSETID",
85cf5c
      "KILL",
85cf5c
      "MKNOD",
85cf5c
      "NET_BIND_SERVICE",
85cf5c
      "NET_RAW",
85cf5c
      "SETGID",
85cf5c
      "SETPCAP",
85cf5c
      "SETUID",
85cf5c
      "SYS_CHROOT",
85cf5c
]
2d4258
```
2d4258
2d4258
**default_sysctls**=[]
85cf5c
85cf5c
A list of sysctls to be set in containers by default,
85cf5c
specified as "name=value".
379816
85cf5c
Example:"net.ipv4.ping_group_range=0 1000".
2d4258
2d4258
**default_ulimits**=[]
85cf5c
85cf5c
A list of ulimits to be set in containers by default,
85cf5c
specified as "name=soft-limit:hard-limit".
379816
85cf5c
Example: "nofile=1024:2048".
2d4258
f9b602
**devices**=[]
f9b602
f9b602
List of devices.
f9b602
Specified as 'device-on-host:device-on-container:permissions'.
f9b602
f9b602
Example: "/dev/sdc:/dev/xvdc:rwm".
f9b602
2d4258
**dns_options**=[]
85cf5c
85cf5c
List of default DNS options to be added to /etc/resolv.conf inside of the
2d4258
container.
2d4258
2d4258
**dns_searches**=[]
85cf5c
85cf5c
List of default DNS search domains to be added to /etc/resolv.conf inside of
2d4258
the container.
2d4258
2d4258
**dns_servers**=[]
85cf5c
85cf5c
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
85cf5c
**env**=["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "TERM=xterm"]
85cf5c
85cf5c
Environment variable list for the container process, used for passing
2d4258
environment variables to the container.
2d4258
2d4258
**env_host**=false
2d4258
85cf5c
Pass all host environment variables into the container.
2d4258
379816
**http_proxy**=true
85cf5c
85cf5c
Default proxy environment variables will be passed into the container.
85cf5c
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
85cf5c
85cf5c
Run an init inside the container that forwards signals and reaps processes.
2d4258
2d4258
**init_path**="/usr/libexec/podman/catatonit"
85cf5c
85cf5c
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"
85cf5c
85cf5c
Default way to to create a IPC namespace for the container.
85cf5c
Options are:
85cf5c
  `private` Create private IPC Namespace for the container.
85cf5c
  `host`    Share host IPC Namespace with the container.
2d4258
379816
**keyring**=true
379816
379816
Indicates whether the container engines create a kernel keyring for use within
379816
the container.
379816
2d4258
**label**=true
85cf5c
379816
Indicates whether the container engine uses MAC(SELinux) container separation via labeling. This option is ignored on disabled systems.
2d4258
2d4258
**log_driver**="k8s-file"
85cf5c
85cf5c
Logging driver for the container. Available options: `k8s-file` and `journald`.
2d4258
2d4258
**log_size_max**=-1
85cf5c
85cf5c
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"
85cf5c
85cf5c
Default way to to create a NET namespace for the container.
85cf5c
Options are:
85cf5c
  `private` Create private NET Namespace for the container.
85cf5c
  `host`    Share host NET Namespace with the container.
85cf5c
  `none`    Containers do not use the network.
2d4258
2d4258
**no_hosts**=false
85cf5c
85cf5c
Create /etc/hosts for the container.  By default, container engines manage
2d4258
/etc/hosts, automatically adding  the container's  own  IP  address.
2d4258
2d4258
**pidns**="private"
85cf5c
85cf5c
Default way to to create a PID namespace for the container.
85cf5c
Options are:
85cf5c
  `private` Create private PID Namespace for the container.
85cf5c
  `host`    Share host PID Namespace with the container.
2d4258
f9b602
**pids_limit**=1024
f9b602
f9b602
Maximum number of processes allowed in a container. 0 indicates that no limit
f9b602
is imposed.
f9b602
2d4258
**seccomp_profile**="/usr/share/containers/seccomp.json"
85cf5c
85cf5c
Path to the seccomp.json profile which is used as the default seccomp profile
2d4258
for the runtime.
2d4258
2d4258
**shm_size**="65536k"
85cf5c
85cf5c
Size of `/dev/shm`. The format is `<number><unit>`. `number` must be greater
2d4258
than `0`.
85cf5c
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=**""
85cf5c
85cf5c
Set timezone in container. Takes IANA timezones as well as `local`, which sets the timezone in the container to match the host machine.
85cf5c
If not set, then containers will run with the time zone specified in the image.
379816
85cf5c
Examples:
85cf5c
  `tz="local"`
85cf5c
  `tz="America/New_York"`
14f7ae
14f7ae
**umask**="0022"
85cf5c
85cf5c
Sets umask inside the container.
14f7ae
2d4258
**userns**="host"
85cf5c
85cf5c
Default way to to create a USER namespace for the container.
85cf5c
Options are:
85cf5c
  `private` Create private USER Namespace for the container.
85cf5c
  `host`    Share host USER Namespace with the container.
2d4258
2d4258
**userns_size**=65536
85cf5c
85cf5c
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
f9b602
**utsns**="private"
f9b602
f9b602
Default way to to create a UTS namespace for the container.
f9b602
Options are:
f9b602
  `private` Create private UTS Namespace for the container.
f9b602
  `host`    Share host UTS Namespace with the container.
f9b602
f9b602
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/",]
85cf5c
85cf5c
List of paths to directories where CNI plugin binaries are located.
2d4258
2d4258
**default_network**="podman"
85cf5c
85cf5c
The network name of the default CNI network to attach pods to.
2d4258
f9b602
**default_subnet**="10.88.0.0/16"
f9b602
f9b602
The subnet to use for the default CNI network (named above in **default_network**).
f9b602
If the default network does not exist, it will be automatically created the first time a tool is run using this subnet.
f9b602
2d4258
**network_config_dir**="/etc/cni/net.d/"
85cf5c
85cf5c
Path to the directory where CNI configuration files are located.
2d4258
f9b602
**volumes**=[]
f9b602
f9b602
List of volumes.
f9b602
Specified as "directory-on-host:directory-in-container:options".
f9b602
f9b602
Example:  "/db:/var/lib/db:ro".
f9b602
2d4258
## ENGINE TABLE
2d4258
The `engine` table contains configuration options used to set up container engines such as Podman and Buildah.
2d4258
f9b602
**active_service**=""
f9b602
f9b602
Name of destination for accessing the Podman service. See SERVICE DESTINATION TABLE below.
379816
2d4258
**cgroup_check**=false
85cf5c
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"
85cf5c
85cf5c
The cgroup management implementation used for the runtime. Supports `cgroupfs`
2d4258
and `systemd`.
2d4258
2d4258
**conmon_env_vars**=[]
85cf5c
85cf5c
Environment variables to pass into Conmon.
2d4258
2d4258
**conmon_path**=[]
85cf5c
85cf5c
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
85cf5c
The default list is:
2d4258
```
2d4258
conmon_path=[
85cf5c
    "/usr/libexec/podman/conmon",
85cf5c
    "/usr/local/libexec/podman/conmon",
85cf5c
    "/usr/local/lib/podman/conmon",
85cf5c
    "/usr/bin/conmon",
85cf5c
    "/usr/sbin/conmon",
85cf5c
    "/usr/local/bin/conmon",
85cf5c
    "/usr/local/sbin/conmon",
85cf5c
    "/run/current-system/sw/bin/conmon",
2d4258
]
2d4258
```
2d4258
2d4258
**detach_keys**="ctrl-p,ctrl-q"
85cf5c
85cf5c
Keys sequence used for detaching a container.
85cf5c
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
85cf5c
85cf5c
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**=[]
85cf5c
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"
85cf5c
85cf5c
Default method to use when logging events.
85cf5c
Valid values: `file`, `journald`, and `none`.
85cf5c
85cf5c
**hooks_dir**=["/etc/containers/oci/hooks.d", ...]
85cf5c
85cf5c
Path to the OCI hooks directories for automatically executed hooks.
2d4258
f9b602
**image_default_format**="oci"|"v2s2"|"v2s1"
f9b602
f9b602
Manifest Type (oci, v2s2, or v2s1) to use when pulling, pushing, building
f9b602
container images. By default images pulled and pushed match the format of the
f9b602
source image. Building/committing defaults to OCI.
f9b602
Note: **image_build_format** is deprecated.
f9b602
2d4258
**image_default_transport**="docker://"
85cf5c
85cf5c
Default transport method for pulling and pushing images.
2d4258
f9b602
**image_parallel_copies**=0
f9b602
f9b602
Maximum number of image layers to be copied (pulled/pushed) simultaneously.
f9b602
Not setting this field will fall back to containers/image defaults. (6)
f9b602
2d4258
**infra_command**="/pause"
85cf5c
85cf5c
Command to run the infra container.
2d4258
f9b602
**infra_image**="k8s.gcr.io/pause:3.4.1"
85cf5c
85cf5c
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"
85cf5c
85cf5c
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
f9b602
**machine_enabled**=false
f9b602
f9b602
Indicates if Podman is running inside a VM via Podman Machine.
f9b602
Podman uses this value to do extra setup around networking from the
f9b602
container inside the VM to to host.
f9b602
85cf5c
**multi_image_archive**=false
85cf5c
85cf5c
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.
85cf5c
2d4258
**namespace**=""
85cf5c
85cf5c
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 "",
85cf5c
which corresponds to no namespace. When no namespace is set, all containers
2d4258
and pods are visible.
2d4258
85cf5c
**network_cmd_path**=""
85cf5c
85cf5c
Path to the slirp4netns binary.
85cf5c
379816
**network_cmd_options**=[]
379816
379816
Default options to pass to the slirp4netns binary.
379816
379816
Example "allow_host_loopback=true"
379816
2d4258
**no_pivot_root**=false
85cf5c
85cf5c
Whether to use chroot instead of pivot_root in the runtime.
2d4258
2d4258
**num_locks**=2048
85cf5c
85cf5c
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
2d4258
**pull_policy**="always"|"missing"|"never"
85cf5c
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
379816
**remote** = false
379816
Indicates whether the application should be running in remote mode. This flag modifies the
379816
--remote option on container engines. Setting the flag to true will default `podman --remote=true` for access to the remote Podman service.
379816
379816
**runtime**=""
85cf5c
85cf5c
Default OCI specific runtime in runtimes that will be used by default. Must
379816
refer to a member of the runtimes table. Default runtime will be searched for
379816
on the system using the priority: "crun", "runc", "kata".
2d4258
f9b602
**runtime_supports_json**=["crun", "runc", "kata", "runsc"]
85cf5c
85cf5c
The list of the OCI runtimes that support `--format=json`.
2d4258
2d4258
**runtime_supports_nocgroups**=["crun"]
85cf5c
85cf5c
The list of OCI runtimes that support running containers without CGroups.
2d4258
2d4258
**runtime_supports_kvm**=["kata"]
85cf5c
85cf5c
The list of OCI runtimes that support running containers with KVM separation.
2d4258
2d4258
**static_dir**="/var/lib/containers/storage/libpod"
85cf5c
85cf5c
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
85cf5c
85cf5c
Number of seconds to wait for container to exit before sending kill signal.
2d4258
379816
**tmp_dir**="/run/libpod"
85cf5c
85cf5c
The path to a temporary directory to store per-boot container.
2d4258
Must be a tmpfs (wiped after reboot).
2d4258
f9b602
## SERVICE DESTINATION TABLE
f9b602
The `service_destinations` table contains configuration options used to set up remote connections to the podman service for the podman API.
f9b602
f9b602
**[service_destinations.{name}]**
f9b602
URI to access the Podman service
f9b602
**uri="ssh://user@production.example.com/run/user/1001/podman/podman.sock"**
f9b602
f9b602
  Example URIs:
f9b602
f9b602
- **rootless local**  - unix://run/user/1000/podman/podman.sock
f9b602
- **rootless remote** - ssh://user@engineering.lab.company.com/run/user/1000/podman/podman.sock
f9b602
- **rootfull local**  - unix://run/podman/podman.sock
f9b602
- **rootfull remote** - ssh://root@10.10.1.136:22/run/podman/podman.sock
f9b602
f9b602
**identity="~/.ssh/id_rsa**
f9b602
f9b602
Path to file containing ssh identity key
f9b602
2d4258
**volume_path**="/var/lib/containers/storage/volumes"
85cf5c
85cf5c
Directory where named volumes will be created in using the default volume
2d4258
driver.
85cf5c
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
379816
**[engine.volume_plugins]**
379816
379816
A table of all the enabled volume plugins on the system. Volume plugins can be
379816
used as the backend for Podman named volumes. Individual plugins are specified
379816
below, as a map of the plugin name (what the plugin will be called) to its path
379816
(filepath of the plugin's unix socket).
379816
2d4258
# FILES
85cf5c
85cf5c
**containers.conf**
85cf5c
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
85cf5c
**storage.conf**
85cf5c
85cf5c
The `/etc/containers/storage.conf` file is the default storage configuration file.
85cf5c
Rootless users can override fields in the storage config by creating
85cf5c
`$HOME/.config/containers/storage.conf`.
85cf5c
85cf5c
If the `CONTAINERS_STORAGE_CONF` path environment variable is set, this path
85cf5c
is used for the storage.conf file rather than the default.
85cf5c
This is primarily used for testing.
85cf5c
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