What is Docker Volume | How to create Volumes | What is Bind Mount | Docker Storage
Вставка
- Опубліковано 4 жов 2024
- 11:26 Bind mount
More about Raghav - automationstep...
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
hub.docker.com...
docs.docker.co...
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
• Docker
UA-cam PLAYLIST
/ @raghavpal
UA-cam
/ automationstepbystep
FACEBOOK
/ automationstepbystep
TWITTER
/ automationsbs
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 _______
Visit - automationstepb...
----------- Follow -----------
UA-cam - / automationstepbystep
Share your knowledge with everyone and,
Never Stop Learning
Raghav
Thank you. By far the most easy to follow explanation I've come across.
Most welcome Gautam.. humbled
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. 🌻
Thanks a lot Rami.. humbled
All of your tutorial with docker is easy to understand and easy to digest. Thank you for making this. This helps a lot.
You're welcome Angelo
Easy, simple informative video thank u sir
Most welcome Prithviraj
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).
Thanks for adding Saurabh
very simple ....yet powerful explanation.
Thanks Maaz
Much appreciate with some simple but to-the-point examples! You are a really good teacher!
Glad it was helpful
the only resource on the internet that did not throw an error--including the documentation. thanks!
Glad to know it helped Ethan
Super, all of your tutorial with docker is easy to understand and easy to digest.
Great to hear this Samuel
Perfect! Understood docker volume in 15 minutes. Thanks a lot!
You are welcome Ramesh
took me 15.07 mins
After reading tons of info and still confused,this video really helped. Thanks a lot.
Happy to know this Ranjith
You are more than a teacher. I am glad I found you. Thank you so so so much.
Thanks Mukesh, humbled by your message
As always Raghav awesome. I already “know” you a few years and you never disappoint
Thanks a ton J Semblano.. humbled
Very well explained for the beginners. Thank you Raghav
Thanks and welcome Mazharul
Thanks Raghav! You have explained the concept clearly and succinctly.
Glad it was helpful!
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 !!
You're very welcome Heshan.. humbled
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.
You're welcome Nawal.
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.
Most welcome Vinoth
Very well explained with simple use cases
Glad it was helpful Manoj
Thanks for putting this video together. Clear and to-the-point. Keep up the good work!
Glad it was helpful Nawaz
this video is very informative. very well explained for begineers. thanks
You're very welcome Prashanth
My god, I've been struggling with the binds for days! Thanks, I now finally get it. I'm an absolute docker beginner.
Glad I could help Leon
one of the best content over internet on docker volumes.
Happy to see this Prabhu
Amazing walkthrough. Loved it✌
thanks Manoj
Thank you so much. Best explanation ever!
You're very welcome!
A very good series. Thank you very much for sharing your knowledge.
Glad you enjoyed it Anura
I'm really like your videos. It's very clear and helpful. Thanks for your videos.
You are welcome!
great job! i will share this to my colleagues
Awesome, thank you Richard
Love you Raghav! God bless you kind sir!
Thanks a lot Nasir
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.
You're welcome Harshil
This made understanding volumes crystal clear, much appreciated.
You're welcome Allen
Your way of explanation is great. Providing notes in the video description section is very helpful. Thanks for enlightening us with your knowledge.
Glad it was helpful Prasenjit
Almost I learned basic .. today... Thank you very much !! Raghav
You're welcome, keep learning.
Wow.. you easily explained it in detail. Excellent video!
Glad you liked it Farrukh
Hi Raghav, really you made my day Hatsoff to your explaination.
So happy to know this Ashok
Thank you very much for this wonderful tutorial. Very Easy Very Informative.
Love from Pakistan.
Most welcome Ateeq
Very good job Raghav. Congratulations !! Very well explained . Thanks a lot
Most welcome Enrico
Really useful tutorial! Thank you!
Most welcome
This tutorial is fantastic! Concise and to the point!
Glad it was helpful Merin
It reads like a Coconut-pie recipe my old granny used to have in her kitchen drawer ....I had to be a very good boy to get some of that pie - thank you so much!
So glad to read this . Thanks
Very nice tutorial 👍. Simple & elegant. Thnks for making such useful tutorial 👍. Really learned a lot😀
So nice of you Abhirup
Simple and practical approach with all the necessary explanation to understand the concept fully. Good Job! Thanks..
Glad it was helpful Fahad
You are awesome raghav, to the point. No extra talk. Thanks for the video.
Thanks a lot. Humbled
Great explanation sir.
Thank you😊
Most welcome Pankaj
Excellent tutorial on Docker Volumes!
So happy to know this Andrew
Thanks a lot i have been struggling to mount a volume on a windows machine the last bit saved me Great Content!
You're welcome Ezra
Sir, you made this video since 2018 and its really helpful for me in 2020. Thank you so much from the heart
You're most welcome Adam, I will also be created latest videos. Check all here - automationstepbystep.com/
Automation Step by Step - Raghav Pal i really want to learn Docker and Jenkins. I purchased a course from Udemmy, but was really hard to understand. Your way was amazing, I really got it from the first time. Your Jenkins and Docker courses are Kinda old? Do you have somewhere courses. I hope you have a Udemmy course. Please let me know. Much appreciated Adam
Automation Step by Step - Raghav Pal I think I can see your courses on Udemmy. But I think Jenkins is old and I am not even able to install it on my Mac. However, can I get a promotion code for Docker course. Thank you
Hi Adam, I will be creating Jenkins and Docker Udemy courses in some time.
Your explanation is very easy to understand and informative! Thank you!!
You're most welcome Hiroyuki
Excellent Raghav!! You explained it very well with practical example. You Rock Man!! Waiting for more such like videos.
Sure Nikhil, thanks for watching
perfect run through... even learned a mac feature (splitscreen )
Great to know Philip
Thanks Raghav,well explained..
Most welcome Vijay
Excellent, now I found a new favourite tech channel
Happy to know Akinjide.
Best wishes,
Raghav
Very nice explanation
Thanks for watching Shashank
The way you explain things is amazing! :)
Thanks Anna
Thank you so much, I keep learning from you. Thanks, a lot.
So nice of you Naing Lin
Thanks so much, this is exactly what I needed to know!
You are so welcome Clara
Wonderful explaination sir. Thank you soo much.It helped me a lott
You are most welcome Pradeep, Do follow other sessions and let me know if you face any issue
thanks a million for the explanation and making a vid on this, really helped my understanding
You're welcome Charlie
Beautiful tutorial run! Many thanks
Just wanted to thank you Raghav Patel
You're welcome Kevin
thank you , ı understant volumes easy with this video
Most welcome
Very useful explanation. Thank you very much!
You're welcome Bernd Glückert
Amazing. Thanks for the practical examples.
You're welcome Mazhar
Very well explained the concept of volume and bind mount.. Thanks a lot
Most welcome Suhas
Oh man... what an excellent explanation...! Thanks!
You're welcome Arturo
Thanks a lot for such a nice explanation
You are most welcome Ambika
Great explanation. Thanks a lot.
You are welcome Avijit
Heyyy, thanks a ton!! Very nice video with a lot of useful information.
Glad it was helpful!
I like all of your videos... It's really very easy n interesting to understand compared to other over rated channels like edureka.. thanks a lot sir!!
So happy and humbled to see your message Deepti.
Its Excellent Teaching and your videos
So nice of you Gopal
Thank you so much for explaining about volume mapping in containers with hands on. Helped me a lot to understand easily. Can you also explain how this volume mapping is handled at the time of autoscaling the containers?
Sure Nisha, will add more tutorials
Fantastic tutorial Sir
Most welcome Radha
I like your videos so much sir good explaination
Thanks and welcome
Informative and easy to understand
CHeers :)
Glad it was helpful Veeresh
Simple and very easy to understand! Thanks!
You're welcome Gaurav
Great content.. especially loved the "recap" credits with music at the end.
Glad you enjoyed it Kenny
My preferred teacher 🤗
Thanks a lot
The best short videos with more info, thanks a lot sir,keep gng
So nice of you Ravi
Thanks for this wonderful video
Most welcome Shankar
Brilliant video. Thank you
Very welcome
Thank you so much .Very helpful
Glad it was helpful Robbin
u are amazing explaining. thanks man
You're welcome Tareq
Very easy to understand tutorial.. 👌.
I guess the problem with using port 70000 is exceeds the max allowed port no of 65535, which is a networking stipulation
thanks for sharing Shantharam
You explained very precisely. Really appreciated. But I have one concern here how can we will get our deleted container data.
Hi Shibasis, I have not tried, here is some information on this - stackoverflow.com/questions/29202787/restore-deleted-container-docker
Good explanation. Cheers
Glad it helped Dimitar
Nicely explained. Precise. Thanks :)
Glad it was helpful Sayanta
Hands down just amazing (the music)... and the teaching too ;)
Thanks for the kind words
thanks raghav pal very useful !!!!!!!!!!!!!!
You're welcome Anand
This was really excellent. Thanks a lot for making such a nice videos.
So nice of you
just wonderful. very well explained. Thank you.
You're welcome Nergalgreed
Excellent mostly at ending sharing key points shows u r 💖 love at work ...
Thanks for the message .
Very simple explanation with examples. Also if you can add networking module in addition will indeed help
Hi Anand, I will check that soon
Expalined it very well. thank you.
Glad you liked it
I have watched your docker videos twice 😍 waiting for advanced docker tutorials :)
So happy to know this Harsha, I will do Advanced Docker. Cannot say a specific time, as I am engaged with multiple things, but will do it surely. Keep yourself subscribed to get notifications
Awesome explanation
❤️
Glad you liked it
Thank you .. !! Helped a lot
You're welcome Rohit
Great work! Clear & simple. This helped me
Happy to know that
Explained very well. Thank you
You're welcome Amit
Great presentation!
Thanks Richard
Superb. Very Simple explanation. keep up the good work.
You're welcome Nitin