From f440f1461345add1f1c6cd8f3feaf359176a1170 Mon Sep 17 00:00:00 2001 From: Zhu Guihua Date: Thu, 24 Mar 2016 09:14:38 +0800 Subject: [PATCH] Add disk quota support for btrfs Signed-off-by: Zhu Guihua --- docs/reference/commandline/dockerd.md | 20 +++++++++++++++++--- man/docker-create.1.md | 1 + man/docker-run.1.md | 3 ++- man/dockerd.8.md | 17 ++++++++++++++--- 4 files changed, 34 insertions(+), 7 deletions(-) diff --git a/docs/reference/commandline/dockerd.md b/docs/reference/commandline/dockerd.md index 842e0516..2ecadbed 100644 --- a/docs/reference/commandline/dockerd.md +++ b/docs/reference/commandline/dockerd.md @@ -185,8 +185,10 @@ Linux kernel as of [3.18.0](https://lkml.org/lkml/2014/10/26/137). Call ### Storage driver options Particular storage-driver can be configured with options specified with -`--storage-opt` flags. Options for `devicemapper` are prefixed with `dm` and -options for `zfs` start with `zfs`. +`--storage-opt` flags. Options for `devicemapper` are prefixed with `dm`, +options for `zfs` start with `zfs` and options for `btrfs` start with `btrfs`. + +#### Devicemapper options * `dm.thinpooldev` @@ -470,7 +472,7 @@ options for `zfs` start with `zfs`. $ dockerd --storage-opt dm.min_free_space=10% ``` -Currently supported options of `zfs`: +#### ZFS options * `zfs.fsname` @@ -482,6 +484,18 @@ Currently supported options of `zfs`: $ dockerd -s zfs --storage-opt zfs.fsname=zroot/docker +#### Btrfs options + +* `btrfs.min_space` + + Specifies the mininum size to use when creating the subvolume which is used + for containers. If user uses disk quota for btrfs when creating or running + a container with **--storage-opt size** option, docker should ensure the + **size** cannot be smaller than **btrfs.min_space**. + + Example use: + $ docker daemon -s btrfs --storage-opt btrfs.min_space=10G + ## Docker runtime execution options The Docker daemon relies on a diff --git a/man/docker-create.1.md b/man/docker-create.1.md index 3f90a3a1..f8a80cd3 100644 --- a/man/docker-create.1.md +++ b/man/docker-create.1.md @@ -333,6 +333,7 @@ unit, `b` is used. Set LIMIT to `-1` to enable unlimited swap. $ docker create -it --storage-opt size=120G fedora /bin/bash This (size) will allow to set the container rootfs size to 120G at creation time. User cannot pass a size less than the Default BaseFS Size. + This option is only available for the `devicemapper`, `btrfs` and `zfs` graphrivers. **--stop-signal**=*SIGTERM* Signal to stop a container. Default is SIGTERM. diff --git a/man/docker-run.1.md b/man/docker-run.1.md index 921ff9a0..8fb856b5 100644 --- a/man/docker-run.1.md +++ b/man/docker-run.1.md @@ -484,7 +484,8 @@ its root filesystem mounted as read only prohibiting any writes. $ docker run -it --storage-opt size=120G fedora /bin/bash This (size) will allow to set the container rootfs size to 120G at creation time. User cannot pass a size less than the Default BaseFS Size. - + This option is only available for the `devicemapper`, `btrfs` and `zfs` graphrivers. + **--stop-signal**=*SIGTERM* Signal to stop a container. Default is SIGTERM. diff --git a/man/dockerd.8.md b/man/dockerd.8.md index 74d7ce6a..2c381fb0 100644 --- a/man/dockerd.8.md +++ b/man/dockerd.8.md @@ -247,9 +247,9 @@ backends use operating system level technologies and can be configured. Specify options to the storage backend with **--storage-opt** flags. The -backends that currently take options are *devicemapper* and *zfs*. -Options for *devicemapper* are prefixed with *dm* and options for *zfs* -start with *zfs*. +backends that currently take options are *devicemapper*, *zfs* and *btrfs*. +Options for *devicemapper* are prefixed with *dm*, options for *zfs* +start with *zfs* and options for *btrfs* start with *btrfs*. Specifically for devicemapper, the default is a "loopback" model which requires no pre-configuration, but is extremely inefficient. Do not @@ -511,6 +511,17 @@ By default docker will pick up the zfs filesystem where docker graph Example use: `dockerd -s zfs --storage-opt zfs.fsname=zroot/docker` +## Btrfs options + +#### btrfs.min_space + +Specifies the mininum size to use when creating the subvolume which is used +for containers. If user uses disk quota for btrfs when creating or running +a container with **--storage-opt size** option, docker should ensure the +**size** cannot be smaller than **btrfs.min_space**. + +Example use: `docker daemon -s btrfs --storage-opt btrfs.min_space=10G` + # CLUSTER STORE OPTIONS The daemon uses libkv to advertise