Signed-off-by: Mary Anthony <mary@docker.com>
| ... | ... |
@@ -71,204 +71,14 @@ status information about the driver. |
| 71 | 71 |
* `Metadata loop file` file attached to `Metadata file`, if loopback device is used |
| 72 | 72 |
* `Library Version` from the libdevmapper used |
| 73 | 73 |
|
| 74 |
-### options |
|
| 74 |
+### About the devicemapper options |
|
| 75 | 75 |
|
| 76 | 76 |
The devicemapper backend supports some options that you can specify |
| 77 | 77 |
when starting the docker daemon using the `--storage-opt` flags. |
| 78 | 78 |
This uses the `dm` prefix and would be used something like `docker -d --storage-opt dm.foo=bar`. |
| 79 | 79 |
|
| 80 |
-Here is the list of supported options: |
|
| 81 |
- |
|
| 82 |
- * `dm.basesize` |
|
| 83 |
- |
|
| 84 |
- Specifies the size to use when creating the base device, which |
|
| 85 |
- limits the size of images and containers. The default value is |
|
| 86 |
- 10G. Note, thin devices are inherently "sparse", so a 10G device |
|
| 87 |
- which is mostly empty doesn't use 10 GB of space on the |
|
| 88 |
- pool. However, the filesystem will use more space for the empty |
|
| 89 |
- case the larger the device is. **Warning**: This value affects the |
|
| 90 |
- system-wide "base" empty filesystem that may already be |
|
| 91 |
- initialized and inherited by pulled images. Typically, a change |
|
| 92 |
- to this value will require additional steps to take effect: 1) |
|
| 93 |
- stop `docker -d`, 2) `rm -rf /var/lib/docker`, 3) start `docker -d`. |
|
| 94 |
- |
|
| 95 |
- Example use: |
|
| 96 |
- |
|
| 97 |
- ``docker -d --storage-opt dm.basesize=20G`` |
|
| 98 |
- |
|
| 99 |
- * `dm.loopdatasize` |
|
| 100 |
- |
|
| 101 |
- Specifies the size to use when creating the loopback file for the |
|
| 102 |
- "data" device which is used for the thin pool. The default size is |
|
| 103 |
- 100G. Note that the file is sparse, so it will not initially take |
|
| 104 |
- up this much space. |
|
| 105 |
- |
|
| 106 |
- Example use: |
|
| 107 |
- |
|
| 108 |
- ``docker -d --storage-opt dm.loopdatasize=200G`` |
|
| 109 |
- |
|
| 110 |
- * `dm.loopmetadatasize` |
|
| 111 |
- |
|
| 112 |
- Specifies the size to use when creating the loopback file for the |
|
| 113 |
- "metadadata" device which is used for the thin pool. The default size is |
|
| 114 |
- 2G. Note that the file is sparse, so it will not initially take |
|
| 115 |
- up this much space. |
|
| 116 |
- |
|
| 117 |
- Example use: |
|
| 118 |
- |
|
| 119 |
- ``docker -d --storage-opt dm.loopmetadatasize=4G`` |
|
| 120 |
- |
|
| 121 |
- * `dm.fs` |
|
| 122 |
- |
|
| 123 |
- Specifies the filesystem type to use for the base device. The supported |
|
| 124 |
- options are "ext4" and "xfs". The default is "ext4" |
|
| 125 |
- |
|
| 126 |
- Example use: |
|
| 127 |
- |
|
| 128 |
- ``docker -d --storage-opt dm.fs=xfs`` |
|
| 129 |
- |
|
| 130 |
- * `dm.mkfsarg` |
|
| 131 |
- |
|
| 132 |
- Specifies extra mkfs arguments to be used when creating the base device. |
|
| 133 |
- |
|
| 134 |
- Example use: |
|
| 135 |
- |
|
| 136 |
- ``docker -d --storage-opt "dm.mkfsarg=-O ^has_journal"`` |
|
| 137 |
- |
|
| 138 |
- * `dm.mountopt` |
|
| 139 |
- |
|
| 140 |
- Specifies extra mount options used when mounting the thin devices. |
|
| 141 |
- |
|
| 142 |
- Example use: |
|
| 143 |
- |
|
| 144 |
- ``docker -d --storage-opt dm.mountopt=nodiscard`` |
|
| 145 |
- |
|
| 146 |
- * `dm.thinpooldev` |
|
| 147 |
- |
|
| 148 |
- Specifies a custom blockdevice to use for the thin pool. |
|
| 149 |
- |
|
| 150 |
- If using a block device for device mapper storage, ideally lvm2 |
|
| 151 |
- would be used to create/manage the thin-pool volume that is then |
|
| 152 |
- handed to docker to exclusively create/manage the thin and thin |
|
| 153 |
- snapshot volumes needed for its containers. Managing the thin-pool |
|
| 154 |
- outside of docker makes for the most feature-rich method of having |
|
| 155 |
- docker utilize device mapper thin provisioning as the backing |
|
| 156 |
- storage for docker's containers. lvm2-based thin-pool management |
|
| 157 |
- feature highlights include: automatic or interactive thin-pool |
|
| 158 |
- resize support, dynamically change thin-pool features, automatic |
|
| 159 |
- thinp metadata checking when lvm2 activates the thin-pool, etc. |
|
| 160 |
- |
|
| 161 |
- Example use: |
|
| 162 |
- |
|
| 163 |
- ``docker -d --storage-opt dm.thinpooldev=/dev/mapper/thin-pool`` |
|
| 164 |
- |
|
| 165 |
- * `dm.datadev` |
|
| 166 |
- |
|
| 167 |
- Specifies a custom blockdevice to use for data for the thin pool. |
|
| 168 |
- |
|
| 169 |
- If using a block device for device mapper storage, ideally both |
|
| 170 |
- datadev and metadatadev should be specified to completely avoid |
|
| 171 |
- using the loopback device. |
|
| 172 |
- |
|
| 173 |
- Example use: |
|
| 174 |
- |
|
| 175 |
- ``docker -d --storage-opt dm.datadev=/dev/sdb1 --storage-opt dm.metadatadev=/dev/sdc1`` |
|
| 176 |
- |
|
| 177 |
- * `dm.metadatadev` |
|
| 178 |
- |
|
| 179 |
- Specifies a custom blockdevice to use for metadata for the thin |
|
| 180 |
- pool. |
|
| 181 |
- |
|
| 182 |
- For best performance the metadata should be on a different spindle |
|
| 183 |
- than the data, or even better on an SSD. |
|
| 184 |
- |
|
| 185 |
- If setting up a new metadata pool it is required to be valid. This |
|
| 186 |
- can be achieved by zeroing the first 4k to indicate empty |
|
| 187 |
- metadata, like this: |
|
| 188 |
- |
|
| 189 |
- ``dd if=/dev/zero of=$metadata_dev bs=4096 count=1`` |
|
| 190 |
- |
|
| 191 |
- Example use: |
|
| 192 |
- |
|
| 193 |
- ``docker -d --storage-opt dm.datadev=/dev/sdb1 --storage-opt dm.metadatadev=/dev/sdc1`` |
|
| 194 |
- |
|
| 195 |
- * `dm.blocksize` |
|
| 196 |
- |
|
| 197 |
- Specifies a custom blocksize to use for the thin pool. The default |
|
| 198 |
- blocksize is 64K. |
|
| 199 |
- |
|
| 200 |
- Example use: |
|
| 201 |
- |
|
| 202 |
- ``docker -d --storage-opt dm.blocksize=512K`` |
|
| 203 |
- |
|
| 204 |
- * `dm.blkdiscard` |
|
| 205 |
- |
|
| 206 |
- Enables or disables the use of blkdiscard when removing |
|
| 207 |
- devicemapper devices. This is enabled by default (only) if using |
|
| 208 |
- loopback devices and is required to resparsify the loopback file |
|
| 209 |
- on image/container removal. |
|
| 210 |
- |
|
| 211 |
- Disabling this on loopback can lead to *much* faster container |
|
| 212 |
- removal times, but will make the space used in /var/lib/docker |
|
| 213 |
- directory not be returned to the system for other use when |
|
| 214 |
- containers are removed. |
|
| 215 |
- |
|
| 216 |
- Example use: |
|
| 217 |
- |
|
| 218 |
- ``docker -d --storage-opt dm.blkdiscard=false`` |
|
| 219 |
- |
|
| 220 |
- * `dm.override_udev_sync_check` |
|
| 221 |
- |
|
| 222 |
- Overrides the `udev` synchronization checks between `devicemapper` and `udev`. |
|
| 223 |
- `udev` is the device manager for the Linux kernel. |
|
| 224 |
- |
|
| 225 |
- To view the `udev` sync support of a Docker daemon that is using the |
|
| 226 |
- `devicemapper` driver, run: |
|
| 227 |
- |
|
| 228 |
- $ docker info |
|
| 229 |
- [...] |
|
| 230 |
- Udev Sync Supported: true |
|
| 231 |
- [...] |
|
| 232 |
- |
|
| 233 |
- When `udev` sync support is `true`, then `devicemapper` and udev can |
|
| 234 |
- coordinate the activation and deactivation of devices for containers. |
|
| 235 |
- |
|
| 236 |
- When `udev` sync support is `false`, a race condition occurs between |
|
| 237 |
- the`devicemapper` and `udev` during create and cleanup. The race condition |
|
| 238 |
- results in errors and failures. (For information on these failures, see |
|
| 239 |
- [docker#4036](https://github.com/docker/docker/issues/4036)) |
|
| 240 |
- |
|
| 241 |
- To allow the `docker` daemon to start, regardless of `udev` sync not being |
|
| 242 |
- supported, set `dm.override_udev_sync_check` to true: |
|
| 243 |
- |
|
| 244 |
- $ docker -d --storage-opt dm.override_udev_sync_check=true |
|
| 245 |
- |
|
| 246 |
- When this value is `true`, the `devicemapper` continues and simply warns |
|
| 247 |
- you the errors are happening. |
|
| 248 |
- |
|
| 249 |
- > **Note**: The ideal is to pursue a `docker` daemon and environment that |
|
| 250 |
- > does support synchronizing with `udev`. For further discussion on this |
|
| 251 |
- > topic, see [docker#4036](https://github.com/docker/docker/issues/4036). |
|
| 252 |
- > Otherwise, set this flag for migrating existing Docker daemons to a |
|
| 253 |
- > daemon with a supported environment. |
|
| 254 |
- |
|
| 255 |
- * `dm.use_deferred_removal` |
|
| 256 |
- |
|
| 257 |
- Enables use of deferred device removal if libdm and kernel driver |
|
| 258 |
- support the mechanism. |
|
| 259 |
- |
|
| 260 |
- Deferred device removal means that if device is busy when devices is |
|
| 261 |
- being removed/deactivated, then a deferred removal is scheduled on |
|
| 262 |
- device. And devices automatically goes away when last user of device |
|
| 263 |
- exits. |
|
| 264 |
- |
|
| 265 |
- For example, when container exits, its associated thin device is |
|
| 266 |
- removed. If that devices has leaked into some other mount namespace |
|
| 267 |
- can can't be removed now, container exit will still be successful |
|
| 268 |
- and this option will just schedule device for deferred removal and |
|
| 269 |
- will not wait in a loop trying to remove a busy device. |
|
| 270 |
- |
|
| 271 |
- Example use: |
|
| 272 |
- |
|
| 273 |
- ``docker -d --storage-opt dm.use_deferred_removal=true`` |
|
| 274 |
- |
|
| 80 |
+These options are currently documented both in [the man |
|
| 81 |
+page](../../../man/docker.1.md) and in [the online |
|
| 82 |
+documentation](https://docs.docker.com/reference/commandline/daemon/#docker- |
|
| 83 |
+execdriver-option). If you add an options, update both the `man` page and the |
|
| 84 |
+documentation. |
| ... | ... |
@@ -178,7 +178,24 @@ Particular storage-driver can be configured with options specified with |
| 178 | 178 |
`--storage-opt` flags. Options for `devicemapper` are prefixed with `dm` and |
| 179 | 179 |
options for `zfs` start with `zfs`. |
| 180 | 180 |
|
| 181 |
-Currently supported options of `devicemapper`: |
|
| 181 |
+* `dm.thinpooldev` |
|
| 182 |
+ |
|
| 183 |
+ Specifies a custom block storage device to use for the thin pool. |
|
| 184 |
+ |
|
| 185 |
+ If using a block device for device mapper storage, it is best to use `lvm` |
|
| 186 |
+ to create and manage the thin-pool volume. This volume is then handed to Docker |
|
| 187 |
+ to exclusively create snapshot volumes needed for images and containers. |
|
| 188 |
+ |
|
| 189 |
+ Managing the thin-pool outside of Docker makes for the most feature-rich |
|
| 190 |
+ method of having Docker utilize device mapper thin provisioning as the |
|
| 191 |
+ backing storage for Docker's containers. The highlights of the lvm-based |
|
| 192 |
+ thin-pool management feature include: automatic or interactive thin-pool |
|
| 193 |
+ resize support, dynamically changing thin-pool features, automatic thinp |
|
| 194 |
+ metadata checking when lvm activates the thin-pool, etc. |
|
| 195 |
+ |
|
| 196 |
+ Example use: |
|
| 197 |
+ |
|
| 198 |
+ docker -d --storage-opt dm.thinpooldev=/dev/mapper/thin-pool |
|
| 182 | 199 |
|
| 183 | 200 |
* `dm.basesize` |
| 184 | 201 |
|
| ... | ... |
@@ -188,9 +205,9 @@ Currently supported options of `devicemapper`: |
| 188 | 188 |
10 GB of space on the pool. However, the filesystem will use more space for |
| 189 | 189 |
the empty case the larger the device is. |
| 190 | 190 |
|
| 191 |
- **Warning:** This value affects the system-wide "base" empty filesystem |
|
| 192 |
- that may already be initialized and inherited by pulled images. Typically, |
|
| 193 |
- a change to this value will require additional steps to take effect: |
|
| 191 |
+ This value affects the system-wide "base" empty filesystem |
|
| 192 |
+ that may already be initialized and inherited by pulled images. Typically, |
|
| 193 |
+ a change to this value requires additional steps to take effect: |
|
| 194 | 194 |
|
| 195 | 195 |
$ sudo service docker stop |
| 196 | 196 |
$ sudo rm -rf /var/lib/docker |
| ... | ... |
@@ -202,9 +219,12 @@ Currently supported options of `devicemapper`: |
| 202 | 202 |
|
| 203 | 203 |
* `dm.loopdatasize` |
| 204 | 204 |
|
| 205 |
- Specifies the size to use when creating the loopback file for the "data" |
|
| 206 |
- device which is used for the thin pool. The default size is 100G. Note that |
|
| 207 |
- the file is sparse, so it will not initially take up this much space. |
|
| 205 |
+ >**Note**: This option configures devicemapper loopback, which should not be used in production. |
|
| 206 |
+ |
|
| 207 |
+ Specifies the size to use when creating the loopback file for the |
|
| 208 |
+ "data" device which is used for the thin pool. The default size is |
|
| 209 |
+ 100G. The file is sparse, so it will not initially take up this |
|
| 210 |
+ much space. |
|
| 208 | 211 |
|
| 209 | 212 |
Example use: |
| 210 | 213 |
|
| ... | ... |
@@ -212,10 +232,12 @@ Currently supported options of `devicemapper`: |
| 212 | 212 |
|
| 213 | 213 |
* `dm.loopmetadatasize` |
| 214 | 214 |
|
| 215 |
+ >**Note**: This option configures devicemapper loopback, which should not be used in production. |
|
| 216 |
+ |
|
| 215 | 217 |
Specifies the size to use when creating the loopback file for the |
| 216 |
- "metadata" device which is used for the thin pool. The default size is 2G. |
|
| 217 |
- Note that the file is sparse, so it will not initially take up this much |
|
| 218 |
- space. |
|
| 218 |
+ "metadadata" device which is used for the thin pool. The default size |
|
| 219 |
+ is 2G. The file is sparse, so it will not initially take up |
|
| 220 |
+ this much space. |
|
| 219 | 221 |
|
| 220 | 222 |
Example use: |
| 221 | 223 |
|
| ... | ... |
@@ -248,6 +270,8 @@ Currently supported options of `devicemapper`: |
| 248 | 248 |
|
| 249 | 249 |
* `dm.datadev` |
| 250 | 250 |
|
| 251 |
+ (Deprecated, use `dm.thinpooldev`) |
|
| 252 |
+ |
|
| 251 | 253 |
Specifies a custom blockdevice to use for data for the thin pool. |
| 252 | 254 |
|
| 253 | 255 |
If using a block device for device mapper storage, ideally both datadev and |
| ... | ... |
@@ -256,12 +280,12 @@ Currently supported options of `devicemapper`: |
| 256 | 256 |
|
| 257 | 257 |
Example use: |
| 258 | 258 |
|
| 259 |
- $ docker -d \ |
|
| 260 |
- --storage-opt dm.datadev=/dev/sdb1 \ |
|
| 261 |
- --storage-opt dm.metadatadev=/dev/sdc1 |
|
| 259 |
+ $ docker -d --storage-opt dm.datadev=/dev/sdb1 --storage-opt dm.metadatadev=/dev/sdc1 |
|
| 262 | 260 |
|
| 263 | 261 |
* `dm.metadatadev` |
| 264 | 262 |
|
| 263 |
+ (Deprecated, use `dm.thinpooldev`) |
|
| 264 |
+ |
|
| 265 | 265 |
Specifies a custom blockdevice to use for metadata for the thin pool. |
| 266 | 266 |
|
| 267 | 267 |
For best performance the metadata should be on a different spindle than the |
| ... | ... |
@@ -270,13 +294,11 @@ Currently supported options of `devicemapper`: |
| 270 | 270 |
If setting up a new metadata pool it is required to be valid. This can be |
| 271 | 271 |
achieved by zeroing the first 4k to indicate empty metadata, like this: |
| 272 | 272 |
|
| 273 |
- $ dd if=/dev/zero of=$metadata_dev bs=4096 count=1 |
|
| 273 |
+ $ dd if=/dev/zero of=$metadata_dev bs=4096 count=1 |
|
| 274 | 274 |
|
| 275 | 275 |
Example use: |
| 276 | 276 |
|
| 277 |
- $ docker -d \ |
|
| 278 |
- --storage-opt dm.datadev=/dev/sdb1 \ |
|
| 279 |
- --storage-opt dm.metadatadev=/dev/sdc1 |
|
| 277 |
+ $ docker -d --storage-opt dm.datadev=/dev/sdb1 --storage-opt dm.metadatadev=/dev/sdc1 |
|
| 280 | 278 |
|
| 281 | 279 |
* `dm.blocksize` |
| 282 | 280 |
|
| ... | ... |
@@ -325,7 +347,7 @@ Currently supported options of `devicemapper`: |
| 325 | 325 |
To allow the `docker` daemon to start, regardless of `udev` sync not being |
| 326 | 326 |
supported, set `dm.override_udev_sync_check` to true: |
| 327 | 327 |
|
| 328 |
- $ docker -d --storage-opt dm.override_udev_sync_check=true |
|
| 328 |
+ $ docker -d --storage-opt dm.override_udev_sync_check=true |
|
| 329 | 329 |
|
| 330 | 330 |
When this value is `true`, the `devicemapper` continues and simply warns |
| 331 | 331 |
you the errors are happening. |
| ... | ... |
@@ -337,6 +359,7 @@ Currently supported options of `devicemapper`: |
| 337 | 337 |
> Otherwise, set this flag for migrating existing Docker daemons to |
| 338 | 338 |
> a daemon with a supported environment. |
| 339 | 339 |
|
| 340 |
+ |
|
| 340 | 341 |
## Docker execdriver option |
| 341 | 342 |
|
| 342 | 343 |
Currently supported options of `zfs`: |
| ... | ... |
@@ -297,79 +297,198 @@ inside it) |
| 297 | 297 |
|
| 298 | 298 |
# STORAGE DRIVER OPTIONS |
| 299 | 299 |
|
| 300 |
-Options to storage backend can be specified with **--storage-opt** flags. The |
|
| 301 |
-only backend which currently takes options is *devicemapper*. Therefore use these |
|
| 300 |
+Docker uses storage backends (known as "graphdrivers" in the Docker |
|
| 301 |
+internals) to create writable containers from images. Many of these |
|
| 302 |
+backends use operating system level technologies and can be |
|
| 303 |
+configured. |
|
| 304 |
+ |
|
| 305 |
+Specify options to the storage backend with **--storage-opt** flags. The only |
|
| 306 |
+backend that currently takes options is *devicemapper*. Therefore use these |
|
| 302 | 307 |
flags with **-s=**devicemapper. |
| 303 | 308 |
|
| 309 |
+Specifically for devicemapper, the default is a "loopback" model which |
|
| 310 |
+requires no pre-configuration, but is extremely inefficient. Do not |
|
| 311 |
+use it in production. |
|
| 312 |
+ |
|
| 313 |
+To make the best use of Docker with the devicemapper backend, you must |
|
| 314 |
+have a recent version of LVM. Use `lvm` to create a thin pool; for |
|
| 315 |
+more information see `man lvmthin`. Then, use `--storage-opt |
|
| 316 |
+dm.thinpooldev` to tell the Docker engine to use that pool for |
|
| 317 |
+allocating images and container snapshots. |
|
| 318 |
+ |
|
| 304 | 319 |
Here is the list of *devicemapper* options: |
| 305 | 320 |
|
| 321 |
+#### dm.thinpooldev |
|
| 322 |
+ |
|
| 323 |
+Specifies a custom block storage device to use for the thin pool. |
|
| 324 |
+ |
|
| 325 |
+If using a block device for device mapper storage, it is best to use |
|
| 326 |
+`lvm` to create and manage the thin-pool volume. This volume is then |
|
| 327 |
+handed to Docker to create snapshot volumes needed for images and |
|
| 328 |
+containers. |
|
| 329 |
+ |
|
| 330 |
+Managing the thin-pool outside of Docker makes for the most feature-rich method |
|
| 331 |
+of having Docker utilize device mapper thin provisioning as the backing storage |
|
| 332 |
+for Docker's containers. The highlights of the LVM-based thin-pool management |
|
| 333 |
+feature include: automatic or interactive thin-pool resize support, dynamically |
|
| 334 |
+changing thin-pool features, automatic thinp metadata checking when lvm activates |
|
| 335 |
+the thin-pool, etc. |
|
| 336 |
+ |
|
| 337 |
+Example use: `docker -d --storage-opt dm.thinpooldev=/dev/mapper/thin-pool` |
|
| 338 |
+ |
|
| 306 | 339 |
#### dm.basesize |
| 307 |
-Specifies the size to use when creating the base device, which limits the size |
|
| 308 |
-of images and containers. The default value is 10G. Note, thin devices are |
|
| 309 |
-inherently "sparse", so a 10G device which is mostly empty doesn't use 10 GB |
|
| 310 |
-of space on the pool. However, the filesystem will use more space for the empty |
|
| 311 |
-case the larger the device is. **Warning**: This value affects the system-wide |
|
| 312 |
-"base" empty filesystem that may already be initialized and inherited by pulled |
|
| 313 |
-images. |
|
| 314 | 340 |
|
| 315 |
-#### dm.loopdatasize |
|
| 316 |
-Specifies the size to use when creating the loopback file for the "data" |
|
| 317 |
-device which is used for the thin pool. The default size is 100G. Note that the |
|
| 318 |
-file is sparse, so it will not initially take up this much space. |
|
| 341 |
+Specifies the size to use when creating the base device, which limits |
|
| 342 |
+the size of images and containers. The default value is 10G. Note, |
|
| 343 |
+thin devices are inherently "sparse", so a 10G device which is mostly |
|
| 344 |
+empty doesn't use 10 GB of space on the pool. However, the filesystem |
|
| 345 |
+will use more space for base images the larger the device |
|
| 346 |
+is. |
|
| 319 | 347 |
|
| 320 |
-#### dm.loopmetadatasize |
|
| 321 |
-Specifies the size to use when creating the loopback file for the "metadadata" |
|
| 322 |
-device which is used for the thin pool. The default size is 2G. Note that the |
|
| 323 |
-file is sparse, so it will not initially take up this much space. |
|
| 348 |
+This value affects the system-wide "base" empty filesystem that may already |
|
| 349 |
+be initialized and inherited by pulled images. Typically, a change to this |
|
| 350 |
+value requires additional steps to take effect: |
|
| 351 |
+ |
|
| 352 |
+ $ sudo service docker stop |
|
| 353 |
+ $ sudo rm -rf /var/lib/docker |
|
| 354 |
+ $ sudo service docker start |
|
| 355 |
+ |
|
| 356 |
+Example use: `docker -d --storage-opt dm.basesize=20G` |
|
| 324 | 357 |
|
| 325 | 358 |
#### dm.fs |
| 326 |
-Specifies the filesystem type to use for the base device. The supported |
|
| 327 |
-options are "ext4" and "xfs". The default is "ext4" |
|
| 359 |
+ |
|
| 360 |
+Specifies the filesystem type to use for the base device. The |
|
| 361 |
+supported options are `ext4` and `xfs`. The default is `ext4`. |
|
| 362 |
+ |
|
| 363 |
+Example use: `docker -d --storage-opt dm.fs=xfs` |
|
| 328 | 364 |
|
| 329 | 365 |
#### dm.mkfsarg |
| 366 |
+ |
|
| 330 | 367 |
Specifies extra mkfs arguments to be used when creating the base device. |
| 331 | 368 |
|
| 369 |
+Example use: `docker -d --storage-opt "dm.mkfsarg=-O ^has_journal"` |
|
| 370 |
+ |
|
| 332 | 371 |
#### dm.mountopt |
| 372 |
+ |
|
| 333 | 373 |
Specifies extra mount options used when mounting the thin devices. |
| 334 | 374 |
|
| 375 |
+Example use: `docker -d --storage-opt dm.mountopt=nodiscard` |
|
| 376 |
+ |
|
| 377 |
+#### dm.use_deferred_removal |
|
| 378 |
+ |
|
| 379 |
+Enables use of deferred device removal if `libdm` and the kernel driver |
|
| 380 |
+support the mechanism. |
|
| 381 |
+ |
|
| 382 |
+Deferred device removal means that if device is busy when devices are |
|
| 383 |
+being removed/deactivated, then a deferred removal is scheduled on |
|
| 384 |
+device. And devices automatically go away when last user of the device |
|
| 385 |
+exits. |
|
| 386 |
+ |
|
| 387 |
+For example, when a container exits, its associated thin device is removed. If |
|
| 388 |
+that device has leaked into some other mount namespace and can't be removed, |
|
| 389 |
+the container exit still succeeds and this option causes the system to schedule |
|
| 390 |
+the device for deferred removal. It does not wait in a loop trying to remove a busy |
|
| 391 |
+device. |
|
| 392 |
+ |
|
| 393 |
+Example use: `docker -d --storage-opt dm.use_deferred_removal=true` |
|
| 394 |
+ |
|
| 395 |
+#### dm.loopdatasize |
|
| 396 |
+ |
|
| 397 |
+**Note**: This option configures devicemapper loopback, which should not be used in production. |
|
| 398 |
+ |
|
| 399 |
+Specifies the size to use when creating the loopback file for the |
|
| 400 |
+"data" device which is used for the thin pool. The default size is |
|
| 401 |
+100G. The file is sparse, so it will not initially take up |
|
| 402 |
+this much space. |
|
| 403 |
+ |
|
| 404 |
+Example use: `docker -d --storage-opt dm.loopdatasize=200G` |
|
| 405 |
+ |
|
| 406 |
+#### dm.loopmetadatasize |
|
| 407 |
+ |
|
| 408 |
+**Note**: This option configures devicemapper loopback, which should not be used in production. |
|
| 409 |
+ |
|
| 410 |
+Specifies the size to use when creating the loopback file for the |
|
| 411 |
+"metadadata" device which is used for the thin pool. The default size |
|
| 412 |
+is 2G. The file is sparse, so it will not initially take up |
|
| 413 |
+this much space. |
|
| 414 |
+ |
|
| 415 |
+Example use: `docker -d --storage-opt dm.loopmetadatasize=4G` |
|
| 416 |
+ |
|
| 335 | 417 |
#### dm.datadev |
| 336 |
-Specifies a custom blockdevice to use for data for the thin pool. |
|
| 337 | 418 |
|
| 338 |
-If using a block device for device mapper storage, ideally both datadev and |
|
| 339 |
-metadatadev should be specified to completely avoid using the loopback device. |
|
| 419 |
+(Deprecated, use `dm.thinpooldev`) |
|
| 340 | 420 |
|
| 341 |
-#### dm.metadatadev |
|
| 342 |
-Specifies a custom blockdevice to use for metadata for the thin pool. |
|
| 421 |
+Specifies a custom blockdevice to use for data for a |
|
| 422 |
+Docker-managed thin pool. It is better to use `dm.thinpooldev` - see |
|
| 423 |
+the documentation for it above for discussion of the advantages. |
|
| 343 | 424 |
|
| 344 |
-For best performance the metadata should be on a different spindle than the |
|
| 345 |
-data, or even better on an SSD. |
|
| 425 |
+#### dm.metadatadev |
|
| 346 | 426 |
|
| 347 |
-If setting up a new metadata pool it is required to be valid. This can be |
|
| 348 |
-achieved by zeroing the first 4k to indicate empty metadata, like this: |
|
| 427 |
+(Deprecated, use `dm.thinpooldev`) |
|
| 349 | 428 |
|
| 350 |
- dd if=/dev/zero of=/dev/metadata_dev bs=4096 count=1 |
|
| 429 |
+Specifies a custom blockdevice to use for metadata for a |
|
| 430 |
+Docker-managed thin pool. See `dm.datadev` for why this is |
|
| 431 |
+deprecated. |
|
| 351 | 432 |
|
| 352 | 433 |
#### dm.blocksize |
| 353 |
-Specifies a custom blocksize to use for the thin pool. The default blocksize |
|
| 354 |
-is 64K. |
|
| 434 |
+ |
|
| 435 |
+Specifies a custom blocksize to use for the thin pool. The default |
|
| 436 |
+blocksize is 64K. |
|
| 437 |
+ |
|
| 438 |
+Example use: `docker -d --storage-opt dm.blocksize=512K` |
|
| 355 | 439 |
|
| 356 | 440 |
#### dm.blkdiscard |
| 357 |
-Enables or disables the use of blkdiscard when removing devicemapper devices. |
|
| 358 |
-This is enabled by default (only) if using loopback devices and is required to |
|
| 359 |
-resparsify the loopback file on image/container removal. |
|
| 360 |
- |
|
| 361 |
-Disabling this on loopback can lead to *much* faster container removal times, |
|
| 362 |
-but will prevent the space used in `/var/lib/docker` directory from being returned to |
|
| 363 |
-the system for other use when containers are removed. |
|
| 364 |
- |
|
| 365 |
-# EXAMPLES |
|
| 366 |
-Launching docker daemon with *devicemapper* backend with particular block devices |
|
| 367 |
-for data and metadata: |
|
| 368 |
- |
|
| 369 |
- docker -d -s=devicemapper \ |
|
| 370 |
- --storage-opt dm.datadev=/dev/vdb \ |
|
| 371 |
- --storage-opt dm.metadatadev=/dev/vdc \ |
|
| 372 |
- --storage-opt dm.basesize=20G |
|
| 441 |
+ |
|
| 442 |
+Enables or disables the use of `blkdiscard` when removing devicemapper |
|
| 443 |
+devices. This is disabled by default due to the additional latency, |
|
| 444 |
+but as a special case with loopback devices it will be enabled, in |
|
| 445 |
+order to re-sparsify the loopback file on image/container removal. |
|
| 446 |
+ |
|
| 447 |
+Disabling this on loopback can lead to *much* faster container removal |
|
| 448 |
+times, but it also prevents the space used in `/var/lib/docker` directory |
|
| 449 |
+from being returned to the system for other use when containers are |
|
| 450 |
+removed. |
|
| 451 |
+ |
|
| 452 |
+Example use: `docker -d --storage-opt dm.blkdiscard=false` |
|
| 453 |
+ |
|
| 454 |
+#### dm.override_udev_sync_check |
|
| 455 |
+ |
|
| 456 |
+By default, the devicemapper backend attempts to synchronize with the |
|
| 457 |
+`udev` device manager for the Linux kernel. This option allows |
|
| 458 |
+disabling that synchronization, to continue even though the |
|
| 459 |
+configuration may be buggy. |
|
| 460 |
+ |
|
| 461 |
+To view the `udev` sync support of a Docker daemon that is using the |
|
| 462 |
+`devicemapper` driver, run: |
|
| 463 |
+ |
|
| 464 |
+ $ docker info |
|
| 465 |
+ [...] |
|
| 466 |
+ Udev Sync Supported: true |
|
| 467 |
+ [...] |
|
| 468 |
+ |
|
| 469 |
+When `udev` sync support is `true`, then `devicemapper` and `udev` can |
|
| 470 |
+coordinate the activation and deactivation of devices for containers. |
|
| 471 |
+ |
|
| 472 |
+When `udev` sync support is `false`, a race condition occurs between |
|
| 473 |
+the`devicemapper` and `udev` during create and cleanup. The race |
|
| 474 |
+condition results in errors and failures. (For information on these |
|
| 475 |
+failures, see |
|
| 476 |
+[docker#4036](https://github.com/docker/docker/issues/4036)) |
|
| 477 |
+ |
|
| 478 |
+To allow the `docker` daemon to start, regardless of whether `udev` sync is |
|
| 479 |
+`false`, set `dm.override_udev_sync_check` to true: |
|
| 480 |
+ |
|
| 481 |
+ $ docker -d --storage-opt dm.override_udev_sync_check=true |
|
| 482 |
+ |
|
| 483 |
+When this value is `true`, the driver continues and simply warns you |
|
| 484 |
+the errors are happening. |
|
| 485 |
+ |
|
| 486 |
+**Note**: The ideal is to pursue a `docker` daemon and environment |
|
| 487 |
+that does support synchronizing with `udev`. For further discussion on |
|
| 488 |
+this topic, see |
|
| 489 |
+[docker#4036](https://github.com/docker/docker/issues/4036). |
|
| 490 |
+Otherwise, set this flag for migrating existing Docker daemons to a |
|
| 491 |
+daemon with a supported environment. |
|
| 373 | 492 |
|
| 374 | 493 |
# EXEC DRIVER OPTIONS |
| 375 | 494 |
|