ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก
What is Docker Compose | How to create docker compose file | How to use Compose
ฝัง
- เผยแพร่เมื่อ 16 ส.ค. 2024
- Free Tutorials - automationstep...
I am Raghav & Today we will learn :
1. What | Why - Docker Compose
2. How to install
3. How to create docker compose file
4. How to use docker compose file to create services
5. Basic Commands
TIPS
Docker compose
: tool for defining & running multi-container docker applications
: use yaml files to configure application services (docker-compose.yml)
: can start all services with a single command : docker compose up
: can stop all services with a single command : docker compose down
: can scale up selected services when required
Step 1 : install docker compose
(already installed on windows and mac with docker)
docker-compose -v
2 Ways
1. github.com/doc...
2. Using PIP
pip install -U docker-compose
Step 2 : Create docker compose file at any location on your system
docker-compose.yml
Step 3 : Check the validity of file by command
docker-compose config
Step 4 : Run docker-compose.yml file by command
docker-compose up -d
Steps 5 : Bring down application by command
docker-compose down
TIPS
How to scale services
-scale
docker-compose up -d --scale database=4
References:
hub.docker.com
github.com/doc...
docs.docker.co...
www.google.co....
_____________________________________________________________
#DockerCompose #DockerComposeIntroduction #DockerContainers #DockerTutorials #DockerTraining #DevOpsTools #DevOpsTraining #DockerCommands #DockerForBeginners #DockerFreeTutorials #DockerforDevOps
DOCKER PLAYLIST
• Docker
TH-cam PLAYLIST
/ @raghavpal
TH-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.
Ask Raghav- bit.ly/2CoJGWf
Interviews - bit.ly/2NIPPxk
All Playlists - bit.ly/2LSiezA
----------- Follow -----------
TH-cam - / automationstepbystep
Share your knowledge with everyone and,
Never Stop Learning
Raghav
Free online courses - automationstepbystep.com/online-courses/
long live man!
I have gone through Udemy courses, there instructor focuses on their task such as CI/CD but here videos are for free and very well explained. Anyone can understand easily and practice for same. I learnt Jenkins, GIT, Docker from your videos.
Thanks a lot for these awesome playlists.
Hi Rishabh, you're most welcome
Very short and comprehensive Explanation. 100/100 marks .
Glad to see this message Aamer
100/100
Nice short tutorial. The best part is you DO show errors and HOW to resolve. Not many folks do that. Thank you.
You're welcome Pavel
Thanks Raghav. Your videos are still helping in 2024 !
Glad to hear that Saurabh
प्रिय राघव,
इस तरह के उपयोगी वीडियो बनाने के लिए कोटि कोटि से धन्यवाद् ||
धन्यवाद
If I didn't like this video, That will be the first mistake of mine for today.. Very well explained 👌
Glad it helped Jaya
The notes you show with a music at the end makes us revise the whole video. Magnificent work you are doing. Thank you
You're very welcome!
Awesome gyaan, Raghav. Thank you for making a crisp and to-the-point video covering basics and showcasing the concepts with practical working.
You're welcome Ajeetz
great sir, in one video i have completely get the clear understanding of docker compose
Great to know this Nagarjuna
Very concise and crisp explanation. What I liked most is, describing in just required detail, and the explaining the alternative ways in a very smart and quick way.
do you know how to get out of composeFile, how to get an insert and the like? Where can I find these abbreviations?
Glad it was helpful Nasim
Great video, even after five years! I believe they have helped many users.
Great to hear that.. so happy and humbled
I have used different resources and videos to get actual creating of docker compose file. With this all my doubts are cleared. Thank you for great content
You are most welcome Parikshit
I know it's quite late, but I have just began my journey in this area as of Automation and CI/CD. What a video, great explanation mate. Thank you so much.
Welcome aboard Binod and all the best for next sessions
love from Islamabd......dil se Dua apke liye sir....................wiish u all the bestttttttttt
Thanks a lot Faizan.. humbled
What a video it is...I have seen many videos about docker but the way you explained is absolutely amazing...
Thank you so much for making it easy for us... Wonderful job ..
You are most welcome Dipanshu
Great video...even 3 years later. Thank you. Subscribed.
Awesome, thank you Pavon
Very simplified way of training people who are new to dockers... Good one Raghav, Thank you.
My pleasure Prashanth
I forgot to share you - the "docker-compose" command now is "docker compose" .... as usual, valuable your videos :) - excellent!
Thanks Manuel
Beautifully explained to start with docker compose. Suggestion: Every time you use DOCKER PS, please show us output of DOCKER PS -A as well (curious to see if containers are dead on DOCKER-COMPOSE DOWN command). Please keep posting more and more videos. Thanks a lot. Cheers!
Thanks for watching Shwetank. Will do.
A big round of applause for Raghav & his skills...
Thanks for watching Rahul
well explained the docker-compose and it can be understand to beginners.
Happy to know this Kandula
Nice! Easy tutorial, nice examples , step-by-step and easy terminal fonts and big to read. Nice slow pace, not too fast to see what you are doing on the screen! Good job.
Glad you enjoyed it Andrew
Thank you
Your videos are very helpful
Most welcome
Man.., Loved the way you explain.., very easy to understand., simple yet elegant ..., Thank you...!!
You're welcome Mahesh
Thanks! Worked perfectly as an introduction to docker compose. Samples are simple and shows very basic thins which perfectly fits for starting!
Glad it helped Pavel
Thank You, Raghav for your explanation.
You're most welcome Shanth
Your docker series helped me to grasp quickly. Thanks for the series, but I didn’t see docker networks module. It will be helpful if you make a video on it.
I will check on that Amora. Thanks for watching
Wonderful boss, very clear, very precise. i had little experience but using commands blindly now its clear, thank you.
You are most welcome Paramesh
I dont understand how are the idiots disliking these videos. Raghav, Ignore them and create such tutorials bro Thanks.
Thanks for your kind words Sandeep.
thank you very much, bro, all hope for you to be the best programmer ever .....
thanks Youssef
I just love the end part summary with the music. Many thanks for the video.
Hope you are already ready with tomorrow's Sunday Special video.
Great Suprotim, Yes Sunday Special ep is coming
Simple and easy to understand thank you!
You're welcome!
Super ... Raghav.
Awesome explanation.
Keep up the good work.
Most welcome Sohail
Very useful vedio. Very clear to understand thank you sir
You're most welcome Thulasi
Great tutorial, thanks for sharing!
Glad you enjoyed it Christopher
Who can not understand your videos?!! So much helpful ❤
Thanks Alli
I have gone through all the 11 videos all are nice, neat and clear. thanks.
You're welcome Haribabu
Your explanations are very crisp and easy to follow.
Glad you like them!
Thanks Raghav pal for your Docker series videos. Very useful to kick start with. Thank you and waiting for advance concepts further
Sure Venkata, will try to work on this
I have learned a lot from you videos. And special credit must be given to the music which is played at the end of each video. Its nice😄😄😄😄😄😄
So nice of you Sandeep. Keep Learning
Thank you so much. I loved watching all your videos and the best part is at the end "If you don't succeed try one more time".
So happy to know this Mukund. Do share your knowledge with others.
Really good video. Just one piece of feedback, you can keep the docker-compose.yml file open, don't need to close it many times
Thanks for the tip!
That was awesome explanation... Really looking forward for the continuation of this tutorial
Glad to know this Ashish
Great video. simply explained.
Thanks Fahis
Thank you sir. Your teaching skill is marvelous... God bless you.
You are most welcome Sophiya
Thanks. Really helps me alot.
Good explanation.
Most welcome
Thanks for the video,its comprehensive.
Most welcome Tarrique
such a wonderful explanation. Thank you so much for short and crisp explanation. Iam a beginner, your videos helped me a lot .
You're very welcome!
Short concise and very efficient video. Thanks Raghav
Most welcome Pradip
Very good doc Raghab. Please create next video with interconnected containers, with dependencies (like, build agent containers will be up once Jenkins server container is up). A jenkins setup will be a perfect example. Through docker compose we need to setup jenkins server, build agents and agents needs to be connected using java web start.Thanks.
Will try this Partha
this would definitely be great !
thank you so much great explanation, I had been looking everywhere for that.
So happy to know it helped
Great Explanation Raghav..!
Thanks Sandeep
Nice demo of Docker compose
Thanks
very informative, thank you
Amazing explanation as always Raghav, highly impressed
Thanks a ton Victor
Thanks again for this valuable video - btw at 13:53 is not necessary remove "" for the ports - at 12:51 in official documentation "" are used and in your first version at 13:27 "" were used too
thanks for adding Manuel, I will check
well explained, very helpful. Thank you so much.
Most welcome Rajesh
The way you explaining about it is really awesome ..Thx alot for composing on it & sharing with us
Glad you liked it Mahesh
Thanks Raghav, It is really nice tutorial.
Most welcome!
nice video..easy to understand and run
Glad you liked it!
Sharing the notes in video description is awesome helpful, thank you
You are welcome Sandeep
Very nice explained videos...! thank you very much...
You're welcome Sandeep
Thanks mate, it's highly impressive and easy to digest video, much appreciated!
Most welcome Tim
Thanks a lot for your this video❗I can cleary understand docker-compose‼️
Glad to hear that Teru
but how to proceed if we have different databases serving different microservices? For eg I have a authorization server running having its own database and similarly 2 more microservices having their own database and serving a api.
Hi Arnob, you should be able to use this for a diverse tech stack. Can find more examples online. I will plan to create a session once I get some time
really very nice and very well explained.
Glad you liked it Mahesh
Thank you for wonderful clean videos
You are so welcome!
Just awesome explanation sir
Thanks and welcome Sravan
Awesome explanation
Glad you liked it Sai
Hey Shout out, Excellent set of videos on Docker I loved it. Thanks for share
You're welcome David
it a well well done video, very very audible, smooth delivery, step by step, a new person can follow, its absolutely fantastic, keep it up, great job, shows you have worked hard honestly, great work again
So happy and humbled to see your message. Thanks for the kind words
Very nice one for beginners :)
Glad you think so Vidyasagar
Very useful video. Thank you
Glad it was helpful Avijit
Thank you very much.. This video help me a lot
You are welcome Ahmad
Thank you very much sir, Please keep it up....
You're welcome Channat
Wished you put in more details about the other parameters too.
I will check on that Shlok and will plan to add in new sessions
Thank you! you made it look vvv simple!!!
You're welcome Anurag
To the point video, keep it up
Thanks,
Wow, very nice. Easy to understand. Thanks.
Great to know this Neelesh
Awesome, Fantastic , superb.. Million thanks,,
You're welcome Harpit
Very precise and to the point discussion and very helpful replies in comments. Thank you mate... Watching from Pakistan... Really appreciated ...
Thanks for watching Farrukh
Your videos are great. Thanks
Most welcome Jacob
Thanks for the series Raghav. Really informative for beginners like me. :) Can you please elaborate on the scaling part, How will the database instances mentioned will communicate with each other and with the app ? Do we have to specify any replication and load balancing methods separately ?
Hi Nithin, i will cover more on this topic. You might be interested in looking at video for Docker Swarm - th-cam.com/video/bU2NNFJ-UXA/w-d-xo.html
For a database, you'll need a database that can be clustered .. Mysql Cluster or something like CrateDB
Hey, You're awesome.. just love the way you teach! :)
Thanks a lot Nazia
Raghav this was a very useful video.. keep it coming.
Sure Saji. Can check all here - automationstepbystep.com/
How database connection strings will point new instances of databases during scaleup
Hi Vivek, this can help th-cam.com/video/PAg_kH49UuY/w-d-xo.html
Excellent explanation sir !!!!!!!!!!!1
Glad you liked it Kamal
good explanation. Thanks
Most welcome Siddhesh
Thank you so much Raghav! May Allah bless you kind sir!!
Thanks a lot Nasir
very well explained.
Glad you liked it Gurmeet
Simple, super, step by step raghav .......
Thanks for the message Raghavendra
Great tutorial man, thanks for it.
You're welcome
That was very helpful
Glad it helped
hi Raghav Pal, very nice and simple tutorial. Thank you so much.
You're welcome Madhusudan
Thanks. This is the explanation I was looking for
You're welcome Kris
Great job dear Raghav. It's very clear for the beginner. I was searching for such videos and finally I found this channel very satisfying. Well done. Can you suggest me any refference book for docker and also I want to learn artifactiry then from where I can do? Thanks
Thanks a lot Mayank, I usually refer online stuff, so not very sure on books, Can check online, You can find all my work here - automationstepbystep.com/
Very nice and clear
Thank you so much
Hi Raghav,
Could you help me to resolve this:
While creating the docker compose file, folder is created at the desktop but i can see the folder as empty.The file i have emtered is not showing on the desktop folder.
Could you help me on this
Swetha
There are a couple of things to consider when you encounter an empty folder after creating a Docker Compose file:
Understanding Docker Volumes:
* Docker Compose volumes are not physical folders created on your desktop. They are named volumes managed by Docker and used to persist data between container restarts.
* When you define a volume in your docker-compose.yml file, Docker creates a dedicated storage area for the data associated with that volume.
Resolving the Empty Folder:
1. Check Docker Compose Configuration:
- Ensure your docker-compose.yml file correctly defines the volume. It should specify a source directory on your host machine (outside the container) and a destination directory within the container.
- Here's an example:
```yaml
volumes:
- ./my-data:/app/data # This mounts the "my-data" folder on your machine to "/app/data" inside the container
```
2. Verify Docker Volume Creation:
- You can list existing Docker volumes using the command: `docker volume ls`
- If the volume is not listed, Docker might not have created it yet. Run `docker-compose up -d` to start the containers in detached mode, which triggers volume creation.
3. Accessing Volume Data:
- You cannot directly access volume data from the mounted folder on your desktop.
- To view the data, you need to:
* Run a bash shell inside the container: `docker exec -it bash`
* Navigate to the destination directory within the container (e.g., `/app/data` in the example above)
* Use commands like `ls` or `cat` to view the contents.
Additional Tips:
* Double-check the paths specified in your docker-compose.yml file for typos.
* Make sure the source directory on your host machine actually contains files.
* Consider using a volume visualization tool for a more intuitive view of volume data within Docker.
By following these steps, you should be able to understand why the folder appears empty on your desktop and how to access the data stored within the Docker volume.
Thank you so much for the quick reply and for additional tips Raghav.
I'm a beginner for this DevOps...ur videos are helping me alot..
Pls make this kind of more videos with real time scenarios
Thank you
thank you very much for the video!!
Most welcome