- [Instructor] The Docker DCA study guide says
that you should be able to know what a storage driver is,
what the various storage driver options are
that are available to you, and what the different use
cases are for those storage drivers.
So, let's explore that a little bit.
First off, what is a storage driver?
Well, in Docker, ideally, you aren't writing
to the container's writable area.
And instead, you're using Docker Volumes,
which we'll talk more about in a future video.
However, there are workloads that require you
to be able to write to the container's writable area
and to be able to do that, you need a storage driver.
To go with Docker's motto, which is that the
batteries are included, but they are changeable,
or pluggable in this case,
there are a number of different storage drivers
that you can plug in and plug out.
A storage driver allows you to write to that
writable layer, but you have a number of different options.
So what are those options?
Well, if you look down here, Docker first recommends
the overlay two storage driver.
It says that that is preferred,
followed by the overlay driver.
None of these require extra configuration,
and overlay two is the default choice in Docker CE,
with device mapper being next.
If we scroll on down, the Docker documentation tells us
that depending on the Linux distribution that you're using,
there are different recommended storage drivers
available to you.
For example, with Docker CE on Ubuntu,
they first recommend AUFS, followed by device mapper,
and then followed by overlay two, overlay, zfs, and vfs.
However, with Docker CE on CentOS,
they first just recommend device mapper followed by VFS.
And then this changes if you're using Docker CE on Fedora.
It even changes again if you're using Docker EE.
If we scroll on down, you can see that,
for example, in Docker for Mac and Docker for Windows,
modifying the storage driver on these platforms
is not even possible.
And, depending on the file system that you have
available to you, that might also determine
the storage driver that you're able to use.
Moving on down in the documentation here,
it's important to note in this big red message here
that says, "When you change your storage driver,
"any existing images and containers become inaccessible."
That's because when you change the driver that
allows you to access the writable layer
of the container, you are, of course,
going to lose access to the containers that were created
using that driver.
So don't just go off and, without some planning,
change the storage driver from one storage driver
to another storage driver because you will
suddenly be unable to access your containers.
And that's a very bad thing.
So how do you see what storage driver
you're currently using,
and how would you change the storage driver?
Let's find out.