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