What is Docker Volume | How to create Volumes | What is Bind Mount | Docker Storage

preview_player
Показать описание
11:26 Bind mount
Today we will learn:
1. What are Volumes
2. How to create / list / delete volumes
3. How to attach volume to a container
4. How to share volume among containers
5. What are bind mounts
Volumes are the preferred mechanism for persisting data generated by and used by Docker containers

: docker volume //get information
: docker volume create
: docker volume ls
: docker volume inspect
: docker volume rm
: docker volume prune

Instead of deleting containers one by one of docker ps -a , we can use docker container prune. and for docker ps (running containers) we can use docker rm $(ps -aq)

Use of Volumes
===========
Decoupling container from storage
Share volume (storage/data) among different containers
Attach volume to container
On deleting container volume does not delete

Commands
docker run --name MyJenkins1 -v myvol1:/var/jenkins_home -p 8080:8080 -p 50000:50000 jenkins
docker run --name MyJenkins2 -v myvol1:/var/jenkins_home -p 9090:8080 -p 60000:50000 jenkins
docker run --name MyJenkins3 -v /Users/raghav/Desktop/Jenkins_Home:/var/jenkins_home -p 9191:8080 -p 40000:50000 jenkins

References

NOTES

By default all files created inside a container are stored on a writable container layer

The data doesn’t persist when that container is no longer running

A container’s writable layer is tightly coupled to the host machine where the container is running. You can’t easily move the data somewhere else.

Docker has two options for containers to store files in the host machine
so that the files are persisted even after the container stops

VOLUMES and BIND MOUNTS

Volumes are stored in a part of the host filesystem which is managed by Docker

Non-Docker processes should not modify this part of the filesystem

Bind mounts may be stored anywhere on the host system

Non-Docker processes on the Docker host or a Docker container can modify them at any time

In Bind Mounts, the file or directory is referenced by its full path on the host machine. 

Volumes are the best way to persist data in Docker

volumes are managed by Docker and are isolated from the core functionality of the host machine

A given volume can be mounted into multiple containers simultaneously.

When no running container is using a volume, the volume is still available to Docker and is not removed automatically. You can remove unused volumes using docker volume prune.

When you mount a volume, it may be named or anonymous. 

Anonymous volumes are not given an explicit name when they are first mounted into a container

Volumes also support the use of volume drivers, which allow you to store your data on remote hosts or cloud providers, among other possibilities.

#DockerVolume #DockerBindMount #DockerContainers #DockerTutorials #DockerTraining #DevOpsTools #DevOpsTraining #DockerCommands #DockerForBeginners #DockerFreeTutorials #DockerforDevOps

DOCKER PLAYLIST

YOUTUBE PLAYLIST

YOUTUBE

FACEBOOK

TWITTER

If you like videos on the channel Automation Step by Step, hit the like button and share with others.

Click the SUBSCRIBE button and hit the bell icon to keep getting new videos.

________ ONLINE COURSES TO LEARN ________

------------ Follow ------------

Share your knowledge with everyone and,
Never Stop Learning
Raghav
Рекомендации по теме
Комментарии
Автор

I am a student currently learning Docker and have struggled to find clear explanations about Docker volumes. Your video is very clear, your voice is easy to understand, and as a thank you, I am now following you. Thank you again and again! i will be sharing your channel and your website with my colleagues too !!

heshanwijeratne
Автор

All of your tutorial with docker is easy to understand and easy to digest. Thank you for making this. This helps a lot.

beunmin
Автор

Thank you. By far the most easy to follow explanation I've come across.

gautamdikshit
Автор

Thank you very very very much for the lesson. What I like the most about your videos is that you teach in a calm and relatively slow pace. Which in my opinion is the key for successful learning. I send you love and blessing. Big like and subscribe from me. 🌻

ramiworkstation
Автор

This is very easy and good explanation Raghav. You represent things in simple way. I really appreciate. Instead of deleting containers one by one of docker ps -a, we can use docker container prune. and for docker ps (running containers) we can use docker rm $(docker ps -aq).

guptasaurabh
Автор

Easy, simple informative video thank u sir

prithvirajsingh
Автор

Wonderful explanation. I was really looking for such kind of video, easy, practical, and live with all the details.
Thank you very much. Keep posting more videos.

nawalsingh
Автор

the only resource on the internet that did not throw an error--including the documentation. thanks!

ethanrose
Автор

Much appreciate with some simple but to-the-point examples! You are a really good teacher!

dragonball
Автор

After reading tons of info and still confused, this video really helped. Thanks a lot.

ranjithreddych
Автор

Perfect! Understood docker volume in 15 minutes. Thanks a lot!

rameshjp
Автор

You are more than a teacher. I am glad I found you. Thank you so so so much.

OddBallTrails
Автор

Thanks for putting this video together. Clear and to-the-point. Keep up the good work!

nawazali
Автор

Thank you very much for this tutorial am very new to docker and learning the concept one by one, your tutorial is more helpful to learn docker.

VinothKumar-jwiy
Автор

As always Raghav awesome. I already “know” you a few years and you never disappoint

jsemblano
Автор

Super, all of your tutorial with docker is easy to understand and easy to digest.

samuelopoku-acheampong
Автор

My god, I've been struggling with the binds for days! Thanks, I now finally get it. I'm an absolute docker beginner.

LeonRamkumar
Автор

Real quality videos with precise and clear explanation. I am grateful for these videos as they teach me so much in mere few minutes. Thanks a ton brother.

hdadpool
Автор

very simple ....yet powerful explanation.

maazkhan
Автор

Thanks Raghav! You have explained the concept clearly and succinctly.

pavithren