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
bae5f5
The STORAGE configuration file specifies all of the available container storage options
bae5f5
for tools using shared container storage, but in a TOML format that can be more easily modified
bae5f5
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**=""
6a0200
  container storage driver (default: "overlay")
6a0200
  Default Copy On Write (COW) container storage driver
6a0200
  Valid drivers are "overlay", "vfs", "devmapper", "aufs", "btrfs", and "zfs"
6a0200
  Some drivers (for example, "zfs", "btrfs", and "aufs") may not work if your kernel lacks support for the filesystem
6a0200
bae5f5
**graphroot**=""
bae5f5
  container storage graph dir (default: "/var/lib/containers/storage")
bae5f5
  Default directory to store all writable content created by container storage programs
bae5f5
bae5f5
**runroot**=""
bae5f5
  container storage run dir (default: "/var/run/containers/storage")
bae5f5
  Default directory to store all temporary writable content created by container storage programs
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
6a0200
**mount_program**=""
6a0200
  Specifies the path to a custom program to use instead of using kernel defaults for mounting the file system.
6a0200
6a0200
      mount_program = "/usr/bin/fuse-overlayfs"
6a0200
6a0200
**mountopt**=""
6a0200
6a0200
  Comma separated list of default options to be used to mount container images.  Suggested value "nodev".
6a0200
6a0200
**ostree_repo** = ""
6a0200
   If specified, use OSTree to deduplicate files with the overlay or vfs backends.
6a0200
bae5f5
**size**=""
6a0200
  Maximum size of a container image.   This flag can be used to set quota on the size of container images. (default: 10GB)
6a0200
6a0200
**skip_mount_home** = "false"
6a0200
   Set to skip a PRIVATE bind mount on the storage home directory.
6a0200
Only supported by certain container storage drivers (overlay).
6a0200
6a0200
**remap-uids=**""
6a0200
**remap-gids=**""
6a0200
6a0200
  Remap-UIDs/GIDs is the mapping from UIDs/GIDs as they should appear inside of
6a0200
a container, to the UIDs/GIDs outside of the container, and the length of the
6a0200
range of UIDs/GIDs.  Additional mapped sets can be listed and will be heeded by
6a0200
libraries, but there are limits to the number of mappings which the kernel will
6a0200
allow when you later attempt to run a container.
bae5f5
6a0200
     Example
6a0200
     remap-uids = 0:1668442479:65536
6a0200
     remap-gids = 0:1668442479:65536
bae5f5
6a0200
     These mappings tell the container engines to map UID 0 inside of the
6a0200
     container to UID 1668442479 outside.  UID 1 will be mapped to 1668442480.
6a0200
     UID 2 will be mapped to 1668442481, etc, for the next 65533 UIDs in
6a0200
     Succession.
bae5f5
6a0200
**remap-user**=""
6a0200
**remap-group**=""
6a0200
6a0200
  Remap-User/Group is a user name which can be used to look up one or more UID/GID
6a0200
ranges in the /etc/subuid or /etc/subgid file.  Mappings are set up starting
6a0200
with an in-container ID of 0 and then a host-level ID taken from the lowest
6a0200
range that matches the specified name, and using the length of that range.
6a0200
Additional ranges are then assigned, using the ranges which specify the
6a0200
lowest host-level IDs first, to the lowest not-yet-mapped in-container ID,
6a0200
until all of the entries have been used for maps.
6a0200
6a0200
      remap-user = "storage"
6a0200
      remap-group = "storage"
6a0200
6a0200
### STORAGE OPTIONS FOR THINPOOL TABLE
bae5f5
bae5f5
The `storage.options.thinpool` table supports the following options:
bae5f5
bae5f5
**autoextend_percent**=""
bae5f5
6a0200
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**=""
bae5f5
6a0200
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**=""
bae5f5
6a0200
Specifies the size to use when creating the base device, which limits the size of images and containers. (default: 10g)
bae5f5
bae5f5
**blocksize**=""
bae5f5
6a0200
Specifies a custom blocksize to use for the thin pool. (default: 64k)
bae5f5
bae5f5
**directlvm_device**=""
bae5f5
6a0200
Specifies a custom block storage device to use for the thin pool. Required for using graphdriver `devicemapper`.
bae5f5
bae5f5
**directlvm_device_force**=""
bae5f5
6a0200
Tells driver to wipe device (directlvm_device) even if device already has a filesystem.  (default: false)
bae5f5
bae5f5
**fs**="xfs"
bae5f5
6a0200
Specifies the filesystem type to use for the base device. (default: xfs)
bae5f5
bae5f5
**log_level**=""
bae5f5
bae5f5
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
bae5f5
**min_free_space**=""
bae5f5
6a0200
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**=""
bae5f5
bae5f5
Specifies extra mkfs arguments to be used when creating the base device.
bae5f5
6a0200
**use_deferred_deletion**=""
bae5f5
6a0200
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**=""
bae5f5
6a0200
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**=""
bae5f5
6a0200
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.)
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
6a0200
Tell SELinux about the new containers storage by setting up an equivalence record.
6a0200
This tells SELinux to label content under the new path, as if it was stored
6a0200
under `/var/lib/containers/storage`.
6a0200
6a0200
```
6a0200
semanage fcontext -a -e /var/lib/containers NEWSTORAGEPATH
6a0200
restorecon -R -v /src/containers
6a0200
```
6a0200
6a0200
The semanage command above tells SELinux to setup the default labeling of
6a0200
`NEWSTORAGEPATH` to match `/var/lib/containers`.  The `restorecon` command
6a0200
tells SELinux to apply the labels to the actual content.
6a0200
6a0200
Now all new content created in these directories will automatically be created
6a0200
with the correct label.
6a0200
6a0200
## SEE ALSO
6a0200
`semanage(8)`, `restorecon(8)`
6a0200
6a0200
## FILES
bae5f5
6a0200
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.
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>