20884f
% containers-storage.conf(5) Container Storage Configuration File
20884f
% Dan Walsh
20884f
% May 2017
20884f
20884f
# NAME
20884f
storage.conf - Syntax of Container Storage configuration file
20884f
20884f
## DESCRIPTION
20884f
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.
20884f
20884f
## FORMAT
20884f
The [TOML format][toml] is used as the encoding of the configuration file.
20884f
Every option and subtable listed here is nested under a global "storage" table.
20884f
No bare options are used. The format of TOML can be simplified to:
20884f
20884f
    [table]
20884f
    option = value
20884f
20884f
    [table.subtable1]
20884f
    option = value
20884f
20884f
    [table.subtable2]
20884f
    option = value
20884f
20884f
## STORAGE TABLE
20884f
20884f
The `storage` table supports the following options:
20884f
20884f
**driver**=""
20884f
  container storage driver
20884f
  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.
20884f
  This field is requiered to guarantee proper operation.
20884f
20884f
**graphroot**=""
20884f
  container storage graph dir (default: "/var/lib/containers/storage")
20884f
  Default directory to store all writable content created by container storage programs.
20884f
  The rootless graphroot path supports environment variable substitutions (ie. `$HOME/containers/storage`)
20884f
20884f
**rootless_storage_path**="$HOME/.local/share/containers/storage"
20884f
  Storage path for rootless users. By default the graphroot for rootless users
20884f
  is set to `$XDG_DATA_HOME/containers/storage`, if XDG_DATA_HOME is set.
20884f
  Otherwise `$HOME/.local/share/containers/storage` is used.  This field can
20884f
  be used if administrators need to change the storage location for all users.
20884f
  The rootless storage path supports environment variable substitutions (ie. `$HOME/containers/storage`)
20884f
20884f
  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).
20884f
20884f
**runroot**=""
20884f
  container storage run dir (default: "/run/containers/storage")
20884f
  Default directory to store all temporary writable content created by container storage programs.
20884f
  The rootless runroot path supports environment variable substitutions (ie. `$HOME/containers/storage`)
20884f
20884f
### STORAGE OPTIONS TABLE
20884f
20884f
The `storage.options` table supports the following options:
20884f
20884f
**additionalimagestores**=[]
20884f
  Paths to additional container image stores. Usually these are read/only and stored on remote network shares.
20884f
20884f
**remap-uids=**""
20884f
**remap-gids=**""
20884f
  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.
20884f
20884f
  Example
20884f
     remap-uids = 0:1668442479:65536
20884f
     remap-gids = 0:1668442479:65536
20884f
20884f
  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.
20884f
20884f
**remap-user**=""
20884f
**remap-group**=""
20884f
  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.
20884f
20884f
  Example
20884f
     remap-user = "containers"
20884f
     remap-group = "containers"
20884f
20884f
**root-auto-userns-user**=""
20884f
  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.
20884f
20884f
**auto-userns-min-size**=1024
20884f
  Auto-userns-min-size is the minimum size for a user namespace created automatically.
20884f
20884f
**auto-userns-max-size**=65536
20884f
  Auto-userns-max-size is the maximum size for a user namespace created automatically.
20884f
20884f
### STORAGE OPTIONS FOR AUFS TABLE
20884f
20884f
The `storage.options.aufs` table supports the following options:
20884f
20884f
**mountopt**=""
20884f
  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.
20884f
20884f
### STORAGE OPTIONS FOR BTRFS TABLE
20884f
20884f
The `storage.options.btrfs` table supports the following options:
20884f
20884f
**min_space**=""
20884f
  Specifies the min space in a btrfs volume.
20884f
20884f
**size**=""
20884f
  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))
20884f
20884f
### STORAGE OPTIONS FOR THINPOOL (devicemapper) TABLE
20884f
20884f
The `storage.options.thinpool` table supports the following options for the `devicemapper` driver:
20884f
20884f
**autoextend_percent**=""
20884f
  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%)
20884f
20884f
**autoextend_threshold**=""
20884f
  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%)
20884f
20884f
**basesize**=""
20884f
  Specifies the size to use when creating the base device, which limits the size of images and containers. (default: 10g)
20884f
20884f
**blocksize**=""
20884f
  Specifies a custom blocksize to use for the thin pool. (default: 64k)
20884f
20884f
**directlvm_device**=""
20884f
  Specifies a custom block storage device to use for the thin pool. Required for using graphdriver `devicemapper`.
20884f
20884f
**directlvm_device_force**=""
20884f
  Tells driver to wipe device (directlvm_device) even if device already has a filesystem.  (default: false)
20884f
20884f
**fs**="xfs"
20884f
  Specifies the filesystem type to use for the base device. (default: xfs)
20884f
20884f
**log_level**=""
20884f
  Sets the log level of devicemapper.
20884f
20884f
    0: LogLevelSuppress 0 (default)
20884f
    2: LogLevelFatal
20884f
    3: LogLevelErr
20884f
    4: LogLevelWarn
20884f
    5: LogLevelNotice
20884f
    6: LogLevelInfo
20884f
    7: LogLevelDebug
20884f
20884f
**metadata_size**=""
20884f
  metadata_size is used to set the `pvcreate --metadatasize` options when creating thin devices. (Default 128k)
20884f
20884f
**min_free_space**=""
20884f
  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%)
20884f
20884f
**mkfsarg**=""
20884f
  Specifies extra mkfs arguments to be used when creating the base device.
20884f
20884f
**mountopt**=""
20884f
  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.
20884f
20884f
**size**=""
20884f
  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))
20884f
20884f
**use_deferred_deletion**=""
20884f
  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).
20884f
20884f
**use_deferred_removal**=""
20884f
  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).
20884f
20884f
**xfs_nospace_max_retries**=""
20884f
  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.)
20884f
20884f
### STORAGE OPTIONS FOR OVERLAY TABLE
20884f
20884f
The `storage.options.overlay` table supports the following options:
20884f
20884f
**ignore_chown_errors** = "false"
20884f
  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)
20884f
20884f
**force_mask** = "0000|shared|private"
20884f
  ForceMask specifies the permissions mask that is used for new files and
20884f
directories.
20884f
The values "shared" and "private" are accepted.  (default: ""). Octal permission
20884f
masks are also accepted.
20884f
20884f
  ``: Not set
20884f
     All files/directories, get set with the permissions identified within the
20884f
image.
20884f
20884f
  `private`: it is equivalent to 0700.
20884f
     All files/directories get set with 0700 permissions.  The owner has rwx
20884f
access to the files. No other users on the system can access the files.
20884f
This setting could be used with networked based home directories.
20884f
20884f
  `shared`: it is equivalent to 0755.
20884f
     The owner has rwx access to the files and everyone else can read, access
20884f
and execute them. This setting is useful for sharing containers storage
20884f
with other users.  For instance, a storage owned by root could be shared
20884f
to rootless users as an additional store.
20884f
NOTE:  All files within the image are made readable and executable by any
20884f
user on the system. Even /etc/shadow within your image is now readable by
20884f
any user.
20884f
20884f
  `OCTAL`: Users can experiment with other OCTAL Permissions.
20884f
20884f
Note: The force_mask Flag is an experimental feature, it could change in the
20884f
future.  When "force_mask" is set the original permission mask is stored in the
20884f
"user.containers.override_stat" xattr and the "mount_program" option must be
20884f
specified. Mount programs like "/usr/bin/fuse-overlayfs" present the extended
20884f
attribute permissions to processes within containers rather then the
20884f
"force_mask"  permissions.
20884f
20884f
**mount_program**=""
20884f
  Specifies the path to a custom program to use instead of using kernel defaults
20884f
for mounting the file system. In rootless mode, without the CAP_SYS_ADMIN
20884f
capability, many kernels prevent mounting of overlay file systems, requiring
20884f
you to specify a mount_program. The mount_program option is also required on
20884f
systems where the underlying storage is btrfs, aufs, zfs, overlay, or ecryptfs
20884f
based file systems.
20884f
  mount_program = "/usr/bin/fuse-overlayfs"
20884f
20884f
**mountopt**=""
20884f
  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.
20884f
20884f
**size**=""
20884f
  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))
20884f
20884f
### STORAGE OPTIONS FOR VFS TABLE
20884f
20884f
The `storage.options.vfs` table supports the following options:
20884f
20884f
**ignore_chown_errors** = "false"
20884f
  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)
20884f
20884f
### STORAGE OPTIONS FOR ZFS TABLE
20884f
20884f
The `storage.options.zfs` table supports the following options:
20884f
20884f
**fsname**=""
20884f
  File System name for the zfs driver
20884f
20884f
**mountopt**=""
20884f
  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.
20884f
20884f
**skip_mount_home=""**
20884f
  Tell storage drivers to not create a PRIVATE bind mount on their home directory.
20884f
20884f
**size**=""
20884f
  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))
20884f
20884f
## SELINUX LABELING
20884f
20884f
When running on an SELinux system, if you move the containers storage graphroot directory, you must make sure the labeling is correct.
20884f
20884f
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`.
20884f
20884f
```
20884f
semanage fcontext -a -e /var/lib/containers NEWSTORAGEPATH
20884f
restorecon -R -v NEWSTORAGEPATH
20884f
```
20884f
20884f
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.
20884f
20884f
Now all new content created in these directories will automatically be created with the correct label.
20884f
20884f
## SEE ALSO
20884f
`semanage(8)`, `restorecon(8)`, `mount(8)`, `fuse-overlayfs(1)`
20884f
20884f
## FILES
20884f
20884f
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.
20884f
20884f
## HISTORY
20884f
May 2017, Originally compiled by Dan Walsh <dwalsh@redhat.com>
20884f
Format copied from crio.conf man page created by Aleksa Sarai <asarai@suse.de>