ab079c
% containers-storage.conf(5) Container Storage Configuration File
ab079c
% Dan Walsh
ab079c
% May 2017
ab079c
ab079c
# NAME
ab079c
storage.conf - Syntax of Container Storage configuration file
ab079c
ab079c
## DESCRIPTION
ab079c
The STORAGE configuration file specifies all of the available container storage options
ab079c
for tools using shared container storage, but in a TOML format that can be more easily modified
ab079c
and versioned.
ab079c
ab079c
## FORMAT
ab079c
The [TOML format][toml] is used as the encoding of the configuration file.
ab079c
Every option and subtable listed here is nested under a global "storage" table.
ab079c
No bare options are used. The format of TOML can be simplified to:
ab079c
ab079c
    [table]
ab079c
    option = value
ab079c
ab079c
    [table.subtable1]
ab079c
    option = value
ab079c
ab079c
    [table.subtable2]
ab079c
    option = value
ab079c
ab079c
## STORAGE TABLE
ab079c
ab079c
The `storage` table supports the following options:
ab079c
ab079c
**driver**=""
ab079c
  container storage driver (default: "overlay")
ab079c
  Default Copy On Write (COW) container storage driver
ab079c
  Valid drivers are "overlay", "vfs", "devmapper", "aufs", "btrfs", and "zfs"
ab079c
  Some drivers (for example, "zfs", "btrfs", and "aufs") may not work if your kernel lacks support for the filesystem
ab079c
ab079c
**graphroot**=""
ab079c
  container storage graph dir (default: "/var/lib/containers/storage")
ab079c
  Default directory to store all writable content created by container storage programs
ab079c
ab079c
**runroot**=""
ab079c
  container storage run dir (default: "/var/run/containers/storage")
ab079c
  Default directory to store all temporary writable content created by container storage programs
ab079c
ab079c
### STORAGE OPTIONS TABLE
ab079c
ab079c
The `storage.options` table supports the following options:
ab079c
ab079c
**additionalimagestores**=[]
ab079c
  Paths to additional container image stores. Usually these are read/only and stored on remote network shares.
ab079c
ab079c
**mount_program**=""
ab079c
  Specifies the path to a custom program to use instead of using kernel defaults for mounting the file system.
ab079c
ab079c
      mount_program = "/usr/bin/fuse-overlayfs"
ab079c
ab079c
**mountopt**=""
ab079c
ab079c
  Comma separated list of default options to be used to mount container images.  Suggested value "nodev".
ab079c
ab079c
**ostree_repo** = ""
ab079c
   If specified, use OSTree to deduplicate files with the overlay or vfs backends.
ab079c
ab079c
**size**=""
ab079c
  Maximum size of a container image.   This flag can be used to set quota on the size of container images. (default: 10GB)
ab079c
ab079c
**skip_mount_home** = "false"
ab079c
   Set to skip a PRIVATE bind mount on the storage home directory.
ab079c
Only supported by certain container storage drivers (overlay).
ab079c
ab079c
**remap-uids=**""
ab079c
**remap-gids=**""
ab079c
ab079c
  Remap-UIDs/GIDs is the mapping from UIDs/GIDs as they should appear inside of
ab079c
a container, to the UIDs/GIDs outside of the container, and the length of the
ab079c
range of UIDs/GIDs.  Additional mapped sets can be listed and will be heeded by
ab079c
libraries, but there are limits to the number of mappings which the kernel will
ab079c
allow when you later attempt to run a container.
ab079c
ab079c
     Example
ab079c
     remap-uids = 0:1668442479:65536
ab079c
     remap-gids = 0:1668442479:65536
ab079c
ab079c
     These mappings tell the container engines to map UID 0 inside of the
ab079c
     container to UID 1668442479 outside.  UID 1 will be mapped to 1668442480.
ab079c
     UID 2 will be mapped to 1668442481, etc, for the next 65533 UIDs in
ab079c
     Succession.
ab079c
ab079c
**remap-user**=""
ab079c
**remap-group**=""
ab079c
ab079c
  Remap-User/Group is a user name which can be used to look up one or more UID/GID
ab079c
ranges in the /etc/subuid or /etc/subgid file.  Mappings are set up starting
ab079c
with an in-container ID of 0 and then a host-level ID taken from the lowest
ab079c
range that matches the specified name, and using the length of that range.
ab079c
Additional ranges are then assigned, using the ranges which specify the
ab079c
lowest host-level IDs first, to the lowest not-yet-mapped in-container ID,
ab079c
until all of the entries have been used for maps.
ab079c
ab079c
      remap-user = "storage"
ab079c
      remap-group = "storage"
ab079c
ab079c
### STORAGE OPTIONS FOR THINPOOL TABLE
ab079c
ab079c
The `storage.options.thinpool` table supports the following options:
ab079c
ab079c
**autoextend_percent**=""
ab079c
ab079c
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%)
ab079c
ab079c
**autoextend_threshold**=""
ab079c
ab079c
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%)
ab079c
ab079c
**basesize**=""
ab079c
ab079c
Specifies the size to use when creating the base device, which limits the size of images and containers. (default: 10g)
ab079c
ab079c
**blocksize**=""
ab079c
ab079c
Specifies a custom blocksize to use for the thin pool. (default: 64k)
ab079c
ab079c
**directlvm_device**=""
ab079c
ab079c
Specifies a custom block storage device to use for the thin pool. Required for using graphdriver `devicemapper`.
ab079c
ab079c
**directlvm_device_force**=""
ab079c
ab079c
Tells driver to wipe device (directlvm_device) even if device already has a filesystem.  (default: false)
ab079c
ab079c
**fs**="xfs"
ab079c
ab079c
Specifies the filesystem type to use for the base device. (default: xfs)
ab079c
ab079c
**log_level**=""
ab079c
ab079c
Sets the log level of devicemapper.
ab079c
ab079c
    0: LogLevelSuppress 0 (default)
ab079c
    2: LogLevelFatal
ab079c
    3: LogLevelErr
ab079c
    4: LogLevelWarn
ab079c
    5: LogLevelNotice
ab079c
    6: LogLevelInfo
ab079c
    7: LogLevelDebug
ab079c
ab079c
**min_free_space**=""
ab079c
ab079c
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%)
ab079c
ab079c
**mkfsarg**=""
ab079c
ab079c
Specifies extra mkfs arguments to be used when creating the base device.
ab079c
ab079c
**use_deferred_deletion**=""
ab079c
ab079c
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).
ab079c
ab079c
**use_deferred_removal**=""
ab079c
ab079c
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).
ab079c
ab079c
**xfs_nospace_max_retries**=""
ab079c
ab079c
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.)
ab079c
ab079c
## SELINUX LABELING
ab079c
ab079c
When running on an SELinux system, if you move the containers storage graphroot directory, you must make sure the labeling is correct.
ab079c
ab079c
Tell SELinux about the new containers storage by setting up an equivalence record.
ab079c
This tells SELinux to label content under the new path, as if it was stored
ab079c
under `/var/lib/containers/storage`.
ab079c
ab079c
```
ab079c
semanage fcontext -a -e /var/lib/containers NEWSTORAGEPATH
ab079c
restorecon -R -v /src/containers
ab079c
```
ab079c
ab079c
The semanage command above tells SELinux to setup the default labeling of
ab079c
`NEWSTORAGEPATH` to match `/var/lib/containers`.  The `restorecon` command
ab079c
tells SELinux to apply the labels to the actual content.
ab079c
ab079c
Now all new content created in these directories will automatically be created
ab079c
with the correct label.
ab079c
ab079c
## SEE ALSO
ab079c
`semanage(8)`, `restorecon(8)`
ab079c
ab079c
## FILES
ab079c
ab079c
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 $HOME/.config/containers/storage.conf file.
ab079c
ab079c
## HISTORY
ab079c
May 2017, Originally compiled by Dan Walsh <dwalsh@redhat.com>
ab079c
Format copied from crio.conf man page created by Aleksa Sarai <asarai@suse.de>