Це відео не доступне.
Перепрошуємо.
What is Docker Compose | How to create docker compose file | How to use Compose
Вставка
- Опубліковано 18 сер 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
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.
Ask Raghav- bit.ly/2CoJGWf
Interviews - bit.ly/2NIPPxk
All Playlists - bit.ly/2LSiezA
----------- Follow -----------
UA-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
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!
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
प्रिय राघव,
इस तरह के उपयोगी वीडियो बनाने के लिए कोटि कोटि से धन्यवाद् ||
धन्यवाद
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 video, even after five years! I believe they have helped many users.
Great to hear that.. so happy and humbled
great sir, in one video i have completely get the clear understanding of docker compose
Great to know this Nagarjuna
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
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
Thank you
Your videos are very helpful
Most welcome
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
Great tutorial, thanks for sharing!
Glad you enjoyed it Christopher
Super ... Raghav.
Awesome explanation.
Keep up the good work.
Most welcome Sohail
A big round of applause for Raghav & his skills...
Thanks for watching Rahul
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.
love from Islamabd......dil se Dua apke liye sir....................wiish u all the bestttttttttt
Thanks a lot Faizan.. humbled
well explained the docker-compose and it can be understand to beginners.
Happy to know this Kandula
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
Thank You, Raghav for your explanation.
You're most welcome Shanth
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
Man.., Loved the way you explain.., very easy to understand., simple yet elegant ..., Thank you...!!
You're welcome Mahesh
Simple and easy to understand thank you!
You're welcome!
very informative, thank you
Great Explanation Raghav..!
Thanks Sandeep
thank you very much, bro, all hope for you to be the best programmer ever .....
thanks Youssef
Very useful vedio. Very clear to understand thank you sir
You're most welcome Thulasi
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 forgot to share you - the "docker-compose" command now is "docker compose" .... as usual, valuable your videos :) - excellent!
Thanks Manuel
Great video. simply explained.
Thanks Fahis
Amazing explanation as always Raghav, highly impressed
Thanks a ton Victor
nice video..easy to understand and run
Glad you liked it!
Thanks for the video,its comprehensive.
Most welcome Tarrique
Very nice explained videos...! thank you very much...
You're welcome Sandeep
well explained, very helpful. Thank you so much.
Most welcome Rajesh
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
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
Thanks. Really helps me alot.
Good explanation.
Most welcome
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
Thanks Raghav, It is really nice tutorial.
Most welcome!
Thank you for wonderful clean videos
You are so welcome!
Hey, You're awesome.. just love the way you teach! :)
Thanks a lot Nazia
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!
thank you so much great explanation, I had been looking everywhere for that.
So happy to know it helped
really very nice and very well explained.
Glad you liked it Mahesh
Very useful video. Thank you
Glad it was helpful Avijit
Short concise and very efficient video. Thanks Raghav
Most welcome Pradip
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
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!
Who can not understand your videos?!! So much helpful ❤
Thanks Alli
Nice demo of Docker compose
Thanks
Thank you sir. Your teaching skill is marvelous... God bless you.
You are most welcome Sophiya
Thanks mate, it's highly impressive and easy to digest video, much appreciated!
Most welcome Tim
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.
Very nice one for beginners :)
Glad you think so Vidyasagar
Thank you very much.. This video help me a lot
You are welcome Ahmad
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 !
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
Just awesome explanation sir
Thanks and welcome Sravan
Your videos are great. Thanks
Most welcome Jacob
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/
Sharing the notes in video description is awesome helpful, thank you
You are welcome Sandeep
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
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 - ua-cam.com/video/bU2NNFJ-UXA/v-deo.html
For a database, you'll need a database that can be clustered .. Mysql Cluster or something like CrateDB
Awesome explanation
Glad you liked it Sai
To the point video, keep it up
Thanks,
How database connection strings will point new instances of databases during scaleup
Hi Vivek, this can help ua-cam.com/video/PAg_kH49UuY/v-deo.html
That was awesome explanation... Really looking forward for the continuation of this tutorial
Glad to know this Ashish
thank you very much for the video!!
Most welcome
Thanks bro it really helped!!!!. 👍🏻
most welcome
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
Raghav this was a very useful video.. keep it coming.
Sure Saji. Can check all here - automationstepbystep.com/
Thank you very much sir, Please keep it up....
You're welcome Channat
good explanation. Thanks
Most welcome Siddhesh
great tutorial, thanks!
You're welcome Dave
The way you explaining about it is really awesome ..Thx alot for composing on it & sharing with us
Glad you liked it Mahesh
Very nice and clear
Thank you so much
Excellent explanation sir !!!!!!!!!!!1
Glad you liked it Kamal
Thanks very much sir 🙏🏾
Most welcome Simon
Really helpfull, thank you!
Most welcome Fabian
Thank you so much Raghav! May Allah bless you kind sir!!
Thanks a lot Nasir
very well explained.
Glad you liked it Gurmeet
That was very helpful
Glad it helped
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.
docker-compose up -d --scale database=4 web=3. Is this the correct command if we want to scale up both services? And for scaling down do we have to kill the individual containers?
Thats right Shivam, you can use docker-compose down to bring down. Check here - docs.docker.com/compose/reference/down/
Thank you so much!
It means a lot me
You're most welcome Thue
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
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!
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 helpful
You are welcome Priyanka
Great tutorial man, thanks for it.
You're welcome
Awesome dear. Look I have question can I get each image variables in docker compose and use it in pipline automatically like by using powershell commands variables? If yes how ? Thank you
Hi Ahmad, I will need to check and do some hands-on for this
Thankyou so much love u buddy❤
Thanks for watching Kowshik
Excellent Video. Up to the point 👌
Glad it was helpful!
Thanks a lot for your this video❗I can cleary understand docker-compose‼️
Glad to hear that Teru