6a0200
% containers-storage.conf(5) Container Storage Configuration File
bae5f5
% Dan Walsh
bae5f5
% May 2017
bae5f5
bae5f5
# NAME
bae5f5
storage.conf - Syntax of Container Storage configuration file
bae5f5
6a0200
## DESCRIPTION
2d4258
The STORAGE configuration file specifies all of the available container storage options for tools using shared container storage, but in a TOML format that can be more easily modified and versioned.
bae5f5
6a0200
## FORMAT
bae5f5
The [TOML format][toml] is used as the encoding of the configuration file.
bae5f5
Every option and subtable listed here is nested under a global "storage" table.
bae5f5
No bare options are used. The format of TOML can be simplified to:
bae5f5
bae5f5
    [table]
bae5f5
    option = value
bae5f5
bae5f5
    [table.subtable1]
bae5f5
    option = value
bae5f5
bae5f5
    [table.subtable2]
bae5f5
    option = value
bae5f5
bae5f5
## STORAGE TABLE
bae5f5
bae5f5
The `storage` table supports the following options:
bae5f5
6a0200
**driver**=""
379816
  container storage driver
2d4258
  Default Copy On Write (COW) container storage driver. Valid drivers are "overlay", "vfs", "devmapper", "aufs", "btrfs", and "zfs". Some drivers (for example, "zfs", "btrfs", and "aufs") may not work if your kernel lacks support for the filesystem.
f9b602
  This field is required to guarantee proper operation.
f9b602
  Valid rootless drivers are "btrfs", "overlay", and "vfs".
f9b602
  Rootless users default to the driver defined in the system configuration when possible.
f9b602
  When the system configuration uses an unsupported rootless driver, rootless users default to "overlay" if available, otherwise "vfs".
6a0200
bae5f5
**graphroot**=""
bae5f5
  container storage graph dir (default: "/var/lib/containers/storage")
2d4258
  Default directory to store all writable content created by container storage programs.
85cf5c
  The rootless graphroot path supports environment variable substitutions (ie. `$HOME/containers/storage`)
2d4258
2d4258
**rootless_storage_path**="$HOME/.local/share/containers/storage"
2d4258
  Storage path for rootless users. By default the graphroot for rootless users
85cf5c
  is set to `$XDG_DATA_HOME/containers/storage`, if XDG_DATA_HOME is set.
85cf5c
  Otherwise `$HOME/.local/share/containers/storage` is used.  This field can
85cf5c
  be used if administrators need to change the storage location for all users.
85cf5c
  The rootless storage path supports environment variable substitutions (ie. `$HOME/containers/storage`)
2d4258
2d4258
  A common use case for this field is to provide a local storage directory when user home directories are NFS-mounted (podman does not support container storage over NFS).
bae5f5
bae5f5
**runroot**=""
379816
  container storage run dir (default: "/run/containers/storage")
2d4258
  Default directory to store all temporary writable content created by container storage programs.
85cf5c
  The rootless runroot path supports environment variable substitutions (ie. `$HOME/containers/storage`)
bae5f5
6a0200
### STORAGE OPTIONS TABLE
bae5f5
bae5f5
The `storage.options` table supports the following options:
bae5f5
bae5f5
**additionalimagestores**=[]
bae5f5
  Paths to additional container image stores. Usually these are read/only and stored on remote network shares.
bae5f5
2d4258
**remap-uids=**""
2d4258
**remap-gids=**""
2d4258
  Remap-UIDs/GIDs is the mapping from UIDs/GIDs as they should appear inside of a container, to the UIDs/GIDs outside of the container, and the length of the range of UIDs/GIDs.  Additional mapped sets can be listed and will be heeded by libraries, but there are limits to the number of mappings which the kernel will allow when you later attempt to run a container.
6a0200
2d4258
  Example
2d4258
     remap-uids = 0:1668442479:65536
2d4258
     remap-gids = 0:1668442479:65536
6a0200
2d4258
  These mappings tell the container engines to map UID 0 inside of the container to UID 1668442479 outside.  UID 1 will be mapped to 1668442480. UID 2 will be mapped to 1668442481, etc, for the next 65533 UIDs in succession.
6a0200
2d4258
**remap-user**=""
2d4258
**remap-group**=""
2d4258
  Remap-User/Group is a user name which can be used to look up one or more UID/GID ranges in the /etc/subuid or /etc/subgid file.  Mappings are set up starting with an in-container ID of 0 and then a host-level ID taken from the lowest range that matches the specified name, and using the length of that range. Additional ranges are then assigned, using the ranges which specify the lowest host-level IDs first, to the lowest not-yet-mapped in-container ID, until all of the entries have been used for maps.
6a0200
2d4258
  Example
2d4258
     remap-user = "containers"
2d4258
     remap-group = "containers"
6a0200
2d4258
**root-auto-userns-user**=""
379816
  Root-auto-userns-user is a user name which can be used to look up one or more UID/GID ranges in the /etc/subuid and /etc/subgid file.  These ranges will be partitioned to containers configured to create automatically a user namespace.  Containers configured to automatically create a user namespace can still overlap with containers having an explicit mapping set.  This setting is ignored when running as rootless.
6a0200
2d4258
**auto-userns-min-size**=1024
2d4258
  Auto-userns-min-size is the minimum size for a user namespace created automatically.
6a0200
2d4258
**auto-userns-max-size**=65536
2d4258
  Auto-userns-max-size is the maximum size for a user namespace created automatically.
6a0200
f9b602
**disable-volatile**=true
f9b602
  If disable-volatile is set, then the "volatile" mount optimization is disabled for all the containers.
f9b602
2d4258
### STORAGE OPTIONS FOR AUFS TABLE
bae5f5
2d4258
The `storage.options.aufs` table supports the following options:
bae5f5
2d4258
**mountopt**=""
2d4258
  Comma separated list of default options to be used to mount container images.  Suggested value "nodev". Mount options are documented in the mount(8) man page.
bae5f5
2d4258
### STORAGE OPTIONS FOR BTRFS TABLE
6a0200
2d4258
The `storage.options.btrfs` table supports the following options:
6a0200
2d4258
**min_space**=""
2d4258
  Specifies the min space in a btrfs volume.
6a0200
2d4258
**size**=""
2d4258
  Maximum size of a container image.   This flag can be used to set quota on the size of container images. (format: <number>[<unit>], where unit = b (bytes), k (kilobytes), m (megabytes), or g (gigabytes))
bae5f5
2d4258
### STORAGE OPTIONS FOR THINPOOL (devicemapper) TABLE
bae5f5
2d4258
The `storage.options.thinpool` table supports the following options for the `devicemapper` driver:
bae5f5
2d4258
**autoextend_percent**=""
2d4258
  Tells the thinpool driver the amount by which the thinpool needs to be grown. This is specified in terms of % of pool size. So a value of 20 means that when threshold is hit, pool will be grown by 20% of existing pool size. (default: 20%)
bae5f5
bae5f5
**autoextend_threshold**=""
2d4258
  Tells the driver the thinpool extension threshold in terms of percentage of pool size. For example, if threshold is 60, that means when pool is 60% full, threshold has been hit. (default: 80%)
bae5f5
bae5f5
**basesize**=""
2d4258
  Specifies the size to use when creating the base device, which limits the size of images and containers. (default: 10g)
bae5f5
bae5f5
**blocksize**=""
2d4258
  Specifies a custom blocksize to use for the thin pool. (default: 64k)
bae5f5
bae5f5
**directlvm_device**=""
2d4258
  Specifies a custom block storage device to use for the thin pool. Required for using graphdriver `devicemapper`.
bae5f5
bae5f5
**directlvm_device_force**=""
2d4258
  Tells driver to wipe device (directlvm_device) even if device already has a filesystem.  (default: false)
bae5f5
bae5f5
**fs**="xfs"
2d4258
  Specifies the filesystem type to use for the base device. (default: xfs)
bae5f5
bae5f5
**log_level**=""
2d4258
  Sets the log level of devicemapper.
bae5f5
6a0200
    0: LogLevelSuppress 0 (default)
bae5f5
    2: LogLevelFatal
bae5f5
    3: LogLevelErr
bae5f5
    4: LogLevelWarn
bae5f5
    5: LogLevelNotice
bae5f5
    6: LogLevelInfo
bae5f5
    7: LogLevelDebug
bae5f5
14f7ae
**metadata_size**=""
14f7ae
  metadata_size is used to set the `pvcreate --metadatasize` options when creating thin devices. (Default 128k)
14f7ae
bae5f5
**min_free_space**=""
2d4258
  Specifies the min free space percent in a thin pool required for new device creation to succeed. Valid values are from 0% - 99%. Value 0% disables. (default: 10%)
bae5f5
bae5f5
**mkfsarg**=""
2d4258
  Specifies extra mkfs arguments to be used when creating the base device.
bae5f5
2d4258
**mountopt**=""
2d4258
  Comma separated list of default options to be used to mount container images.  Suggested value "nodev". Mount options are documented in the mount(8) man page.
bae5f5
2d4258
**size**=""
379816
  Maximum size of a container image.  This flag can be used to set quota on the size of container images. (format: <number>[<unit>], where unit = b (bytes), k (kilobytes), m (megabytes), or g (gigabytes))
bae5f5
2d4258
**use_deferred_deletion**=""
2d4258
  Marks thinpool device for deferred deletion. If the thinpool is in use when the driver attempts to delete it, the driver will attempt to delete device every 30 seconds until successful, or when it restarts.  Deferred deletion permanently deletes the device and all data stored in the device will be lost. (default: true).
bae5f5
bae5f5
**use_deferred_removal**=""
2d4258
  Marks devicemapper block device for deferred removal.  If the device is in use when its driver attempts to remove it, the driver tells the kernel to remove the device as soon as possible.  Note this does not free up the disk space, use deferred deletion to fully remove the thinpool.  (default: true).
bae5f5
6a0200
**xfs_nospace_max_retries**=""
2d4258
  Specifies the maximum number of retries XFS should attempt to complete IO when ENOSPC (no space) error is returned by underlying storage device. (default: 0, which means to try continuously.)
2d4258
2d4258
### STORAGE OPTIONS FOR OVERLAY TABLE
2d4258
2d4258
The `storage.options.overlay` table supports the following options:
2d4258
2d4258
**ignore_chown_errors** = "false"
2d4258
  ignore_chown_errors can be set to allow a non privileged user running with a  single UID within a user namespace to run containers. The user can pull and use any image even those with multiple uids.  Note multiple UIDs will be squashed down to the default uid in the container.  These images will have no separation between the users in the container. (default: false)
2d4258
379816
**force_mask** = "0000|shared|private"
379816
  ForceMask specifies the permissions mask that is used for new files and
379816
directories.
379816
The values "shared" and "private" are accepted.  (default: ""). Octal permission
379816
masks are also accepted.
379816
379816
  ``: Not set
379816
     All files/directories, get set with the permissions identified within the
379816
image.
379816
379816
  `private`: it is equivalent to 0700.
379816
     All files/directories get set with 0700 permissions.  The owner has rwx
379816
access to the files. No other users on the system can access the files.
379816
This setting could be used with networked based home directories.
379816
379816
  `shared`: it is equivalent to 0755.
379816
     The owner has rwx access to the files and everyone else can read, access
379816
and execute them. This setting is useful for sharing containers storage
379816
with other users.  For instance, a storage owned by root could be shared
379816
to rootless users as an additional store.
379816
NOTE:  All files within the image are made readable and executable by any
379816
user on the system. Even /etc/shadow within your image is now readable by
379816
any user.
379816
379816
  `OCTAL`: Users can experiment with other OCTAL Permissions.
379816
379816
Note: The force_mask Flag is an experimental feature, it could change in the
379816
future.  When "force_mask" is set the original permission mask is stored in the
379816
"user.containers.override_stat" xattr and the "mount_program" option must be
379816
specified. Mount programs like "/usr/bin/fuse-overlayfs" present the extended
379816
attribute permissions to processes within containers rather then the
379816
"force_mask"  permissions.
379816
2d4258
**mount_program**=""
2d4258
  Specifies the path to a custom program to use instead of using kernel defaults
2d4258
for mounting the file system. In rootless mode, without the CAP_SYS_ADMIN
2d4258
capability, many kernels prevent mounting of overlay file systems, requiring
2d4258
you to specify a mount_program. The mount_program option is also required on
2d4258
systems where the underlying storage is btrfs, aufs, zfs, overlay, or ecryptfs
2d4258
based file systems.
2d4258
  mount_program = "/usr/bin/fuse-overlayfs"
bae5f5
2d4258
**mountopt**=""
2d4258
  Comma separated list of default options to be used to mount container images.  Suggested value "nodev". Mount options are documented in the mount(8) man page.
2d4258
2d4258
**size**=""
2d4258
  Maximum size of a container image.   This flag can be used to set quota on the size of container images. (format: <number>[<unit>], where unit = b (bytes), k (kilobytes), m (megabytes), or g (gigabytes))
2d4258
2d4258
### STORAGE OPTIONS FOR VFS TABLE
2d4258
2d4258
The `storage.options.vfs` table supports the following options:
2d4258
2d4258
**ignore_chown_errors** = "false"
2d4258
  ignore_chown_errors can be set to allow a non privileged user running with a  single UID within a user namespace to run containers. The user can pull and use any image even those with multiple uids.  Note multiple UIDs will be squashed down to the default uid in the container.  These images will have no separation between the users in the container. (default: false)
2d4258
2d4258
### STORAGE OPTIONS FOR ZFS TABLE
2d4258
2d4258
The `storage.options.zfs` table supports the following options:
2d4258
2d4258
**fsname**=""
2d4258
  File System name for the zfs driver
2d4258
2d4258
**mountopt**=""
2d4258
  Comma separated list of default options to be used to mount container images.  Suggested value "nodev". Mount options are documented in the mount(8) man page.
2d4258
14f7ae
**skip_mount_home=""**
14f7ae
  Tell storage drivers to not create a PRIVATE bind mount on their home directory.
14f7ae
2d4258
**size**=""
2d4258
  Maximum size of a container image.   This flag can be used to set quota on the size of container images. (format: <number>[<unit>], where unit = b (bytes), k (kilobytes), m (megabytes), or g (gigabytes))
bae5f5
6a0200
## SELINUX LABELING
6a0200
6a0200
When running on an SELinux system, if you move the containers storage graphroot directory, you must make sure the labeling is correct.
6a0200
2d4258
Tell SELinux about the new containers storage by setting up an equivalence record. This tells SELinux to label content under the new path, as if it was stored under `/var/lib/containers/storage`.
6a0200
6a0200
```
6a0200
semanage fcontext -a -e /var/lib/containers NEWSTORAGEPATH
2d4258
restorecon -R -v NEWSTORAGEPATH
6a0200
```
6a0200
2d4258
The semanage command above tells SELinux to setup the default labeling of `NEWSTORAGEPATH` to match `/var/lib/containers`.  The `restorecon` command tells SELinux to apply the labels to the actual content.
6a0200
2d4258
Now all new content created in these directories will automatically be created with the correct label.
6a0200
6a0200
## SEE ALSO
379816
`semanage(8)`, `restorecon(8)`, `mount(8)`, `fuse-overlayfs(1)`
6a0200
6a0200
## FILES
bae5f5
2d4258
Distributions often provide a `/usr/share/containers/storage.conf` file to define default storage configuration. Administrators can override this file by creating `/etc/containers/storage.conf` to specify their own configuration. The storage.conf file for rootless users is stored in the `$XDG_CONFIG_HOME/containers/storage.conf` file.  If `$XDG_CONFIG_HOME` is not set then the file `$HOME/.config/containers/storage.conf` is used.
bae5f5
6a0200
## HISTORY
bae5f5
May 2017, Originally compiled by Dan Walsh <dwalsh@redhat.com>
bae5f5
Format copied from crio.conf man page created by Aleksa Sarai <asarai@suse.de>