I am learning Docker storage and I am not clear about Docker storage drivers.
Changing the Storage Driver for a Container If you wanted to change to the storage driver used for a container, you can do so when launching the container. This can be done by using the –volume-driver parameter when using the docker run command. An example is given below −
For Docker Engine - Enterprise and Docker Enterprise, the definitive resource for which storage drivers are supported is the Product compatibility matrix. To get commercial support from Docker, you must use a supported configuration.
Storage drivers are intrinsically linked to a container’s “writable layer.” This term refers to the topmost level of a container’s filesystem which you can modify by running commands, writing files, and adding software at runtime.
With regard to Docker, the backing filesystem is the filesystem where /var/lib/docker/ is located. Some storage drivers only work with specific backing filesystems. Among other things, each storage driver has its own performance characteristics that make it more or less suitable for different workloads. Consider the following generalizations:
I suggest you go and look at the presentation from one of the docker developers: http://www.slideshare.net/Docker/docker-storage-drivers
What is docker's storage driver in layman's terms?
When you use the FROM
command in a Dockerfile
you are referring to a base image. Rather than copy everything in a new image, you will share the contents (a.k.a. fs layers); this is what is known as a copy-on-write (holy cow!) filesystem. The docker storage driver is just which kind of COW implementation to use (AUFS
, BTRFS
...). If you imagine your images as layers and depending on each other, you get a graph.
How is it different than Backing Filesystem that docker info command shows?
Same difference between logical and physical representation. The filesystem may be mounted as ext4
(where docker is installed) but used by docker
daemon to leverage COW semantics.
If someone wants to write his own storage driver? How to do that?
Go and take a look at the graphdriver
(manages the graph of layers).
https://github.com/docker/docker/tree/master/daemon/graphdriver
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With