github.com/endocode/docker@v1.4.2-0.20160113120958-46eb4700391e/docs/userguide/storagedriver/selectadriver.md (about) 1 <!--[metadata]> 2 +++ 3 title = "Select a storage driver" 4 description = "Learn how select the proper storage driver for your container." 5 keywords = ["container, storage, driver, AUFS, btfs, devicemapper,zvfs"] 6 [menu.main] 7 parent = "mn_storage_docker" 8 weight = -1 9 +++ 10 <![end-metadata]--> 11 12 # Select a storage driver 13 14 This page describes Docker's storage driver feature. It lists the storage 15 driver's that Docker supports and the basic commands associated with managing them. Finally, this page provides guidance on choosing a storage driver. 16 17 The material on this page is intended for readers who already have an [understanding of the storage driver technology](imagesandcontainers.md). 18 19 ## A pluggable storage driver architecture 20 21 The Docker has a pluggable storage driver architecture. This gives you the flexibility to "plug in" the storage driver is best for your environment and use-case. Each Docker storage driver is based on a Linux filesystem or volume manager. Further, each storage driver is free to implement the management of image layers and the container layer in it's own unique way. This means some storage drivers perform better than others in different circumstances. 22 23 Once you decide which driver is best, you set this driver on the Docker daemon at start time. As a result, the Docker daemon can only run one storage driver, and all containers created by that daemon instance use the same storage driver. The table below shows the supported storage driver technologies and their driver names: 24 25 |Technology |Storage driver name | 26 |--------------|---------------------| 27 |OverlayFS |`overlay` | 28 |AUFS |`aufs` | 29 |Btrfs |`btrfs` | 30 |Device Mapper |`devicemapper` | 31 |VFS* |`vfs` | 32 |ZFS |`zfs` | 33 34 To find out which storage driver is set on the daemon , you use the `docker info` command: 35 36 $ docker info 37 Containers: 0 38 Images: 0 39 Storage Driver: overlay 40 Backing Filesystem: extfs 41 Execution Driver: native-0.2 42 Logging Driver: json-file 43 Kernel Version: 3.19.0-15-generic 44 Operating System: Ubuntu 15.04 45 ... output truncated ... 46 47 The `info` subcommand reveals that the Docker daemon is using the `overlay` storage driver with a `Backing Filesystem` value of `extfs`. The `extfs` value means that the `overlay` storage driver is operating on top of an existing (ext) filesystem. The backing filesystem refers to the filesystem that was used to create the Docker host's local storage area under `/var/lib/docker`. 48 49 Which storage driver you use, in part, depends on the backing filesystem you plan to use for your Docker host's local storage area. Some storage drivers can operate on top of different backing filesystems. However, other storage drivers require the backing filesystem to be the same as the storage driver. For example, the `btrfs` storage driver on a `btrfs` backing filesystem. The following table lists each storage driver and whether it must match the host's backing file system: 50 51 |Storage driver |Must match backing filesystem | 52 |---------------|------------------------------| 53 |overlay |No | 54 |aufs |No | 55 |btrfs |Yes | 56 |devicemapper |No | 57 |vfs* |No | 58 |zfs |Yes | 59 60 61 You can set the storage driver by passing the `--storage-driver=<name>` option to the `docker daemon` command line or by setting the option on the `DOCKER_OPTS` line in `/etc/default/docker` file. 62 63 The following command shows how to start the Docker daemon with the `devicemapper` storage driver using the `docker daemon` command: 64 65 $ docker daemon --storage-driver=devicemapper & 66 67 $ docker info 68 Containers: 0 69 Images: 0 70 Storage Driver: devicemapper 71 Pool Name: docker-252:0-147544-pool 72 Pool Blocksize: 65.54 kB 73 Backing Filesystem: extfs 74 Data file: /dev/loop0 75 Metadata file: /dev/loop1 76 Data Space Used: 1.821 GB 77 Data Space Total: 107.4 GB 78 Data Space Available: 3.174 GB 79 Metadata Space Used: 1.479 MB 80 Metadata Space Total: 2.147 GB 81 Metadata Space Available: 2.146 GB 82 Udev Sync Supported: true 83 Deferred Removal Enabled: false 84 Data loop file: /var/lib/docker/devicemapper/devicemapper/data 85 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata 86 Library Version: 1.02.90 (2014-09-01) 87 Execution Driver: native-0.2 88 Logging Driver: json-file 89 Kernel Version: 3.19.0-15-generic 90 Operating System: Ubuntu 15.04 91 <output truncated> 92 93 Your choice of storage driver can affect the performance of your containerized applications. So it's important to understand the different storage driver options available and select the right one for your application. Later, in this page you'll find some advice for choosing an appropriate driver. 94 95 ## Shared storage systems and the storage driver 96 97 Many enterprises consume storage from shared storage systems such as SAN and NAS arrays. These often provide increased performance and availability, as well as advanced features such as thin provisioning, deduplication and compression. 98 99 The Docker storage driver and data volumes can both operate on top of storage provided by shared storage systems. This allows Docker to leverage the increased performance and availability these systems provide. However, Docker does not integrate with these underlying systems. 100 101 Remember that each Docker storage driver is based on a Linux filesystem or volume manager. Be sure to follow existing best practices for operating your storage driver (filesystem or volume manager) on top of your shared storage system. For example, if using the ZFS storage driver on top of *XYZ* shared storage system, be sure to follow best practices for operating ZFS filesystems on top of XYZ shared storage system. 102 103 ## Which storage driver should you choose? 104 105 As you might expect, the answer to this question is "it depends". While there are some clear cases where one particular storage driver outperforms other for certain workloads, you should factor all of the following into your decision: 106 107 Choose a storage driver that you and your team/organization are comfortable with. Consider how much experience you have with a particular storage driver. There is no substitute for experience and it is rarely a good idea to try something brand new in production. That's what labs and laptops are for! 108 109 If your Docker infrastructure is under support contracts, choose an option that will get you good support. You probably don't want to go with a solution that your support partners have little or no experience with. 110 111 Whichever driver you choose, make sure it has strong community support and momentum. This is important because storage driver development in the Docker project relies on the community as much as the Docker staff to thrive. 112 113 114 ## Related information 115 116 * [Understand images, containers, and storage drivers](imagesandcontainers.md) 117 * [AUFS storage driver in practice](aufs-driver.md) 118 * [Btrfs storage driver in practice](btrfs-driver.md) 119 * [Device Mapper storage driver in practice](device-mapper-driver.md)