- [Instructor] Another way to get your data
out of a container and not store persistent data
in a container is to use a bind mount.
Now, bind mounts aren't the recommended way.
Volumes are the recommended way,
but it's still important to know a little bit about
what a bind mound is.
Bind mounts have been around for a long time.
And if you compare what they can do to volumes,
well, they have limited functionality.
So honestly, I'm not going to spend a lot of time on them.
It's important to be familiar with the Docker documentation
on what a bind mount is
and why you would or would not use it.
To actually use a bind mount,
you simply mount it using minus v or dash dash mount,
just like you would do with a volume.
Notice here, with the dash dash mount option,
we use the type of bind because it's a bind mount,
and the source
can't be a name.
It has to be a specific path,
or, in this case, as you can see, it could be a variable.
So that's one of the benefits of a volume
is you can specify a volume name.
Whereas, with a bind mount,
it has to be an actual file path,
and so that is a disadvantage.
But other than that,
actually starting a container with a bind mount
works very similar to starting a container with a volume.
It's just important to know the limitations of bind mounts.
Let's go over to the lab and give it a try.