Introduction to Docker Swarm | Tutorial for Beginners | Examples | Typical Tasks

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ก.ย. 2024
  • In this Docker Swarm tutorial we’ll build the basic Swarm skills that you’ll need in your project work. You’ll learn to set up a Swarm cluster, Deploy applications, explore and manage your stack in the cluster, and we’ll also go through typical maintenance activities that you’ll need.
    You can find the article form of this tutorial on my blog here: takacsmark.com...
    This is a code-along tutorial, so please open up your terminal and get ready. We’ll use a two step approach:
    We’ll set up a cluster and deploy an application first. The goal here is to show you what Swarm is all about and what it’s capable of. We’ll set up a one machine cluster on your local machine first, and then we’ll set up a cluster of two hosts.
    Once you get the big picture in step 1, I’ll explain all details behind. I think it’s easier to learn and understand after you’ve seen the stuff in action.
    In order to get the most out of this article you should be familiar with basic Docker concepts, like containers, images, the Dockerfile and Docker Compose. If you need a refresher on these topics, please go to my previous tutorials first. Alternatively you can get my book for a complete guided experience.

ความคิดเห็น • 83

  • @lemurza5236
    @lemurza5236 3 ปีที่แล้ว +2

    I hate it when I find such a great channel that seems to be dead. You should really consider making more content. Your style of teaching is amazing

  • @hosnimahmoudi2579
    @hosnimahmoudi2579 3 ปีที่แล้ว +1

    I bedanke mich fùr Ihre Helfe. Sie sind sehr hilfsbereit.

  • @Karthik1516
    @Karthik1516 8 หลายเดือนก่อน

    I have been using standalone docker for a while, merely as an alternative to virtualization. Now, upgrading all our dedicated servers in the cloud, and thought it was a good time to learn about swarm and build them in a highly available and scalable way. I understood the concept from your talk. Thank You so much.

  • @gagangupta1255
    @gagangupta1255 5 ปีที่แล้ว +2

    God bless you Mark, for creating such an amazing videos- which are far better than the paid tutorials that I have purchased online

  • @Blixzful
    @Blixzful 4 ปีที่แล้ว +6

    This is a good talk, but maybe you could continue this with explaining how to manage swarm in production, and how to automate deployments from push to server.

  • @srinidhiii
    @srinidhiii 4 ปีที่แล้ว +1

    wonderful tutorial!!.standing ovation to you sir

  • @stephenremillard9462
    @stephenremillard9462 2 ปีที่แล้ว

    Fantastic explantation in just enough time. Thank you sir!

  • @MehdiBouzidi
    @MehdiBouzidi 3 ปีที่แล้ว

    I'm just at the middle of the video and it's so well explained and interresting !!! THANKS

  • @ashmansingh872
    @ashmansingh872 4 ปีที่แล้ว +1

    one of the best tutorial video's on docker..., awesome stuff.

  • @arsalanahmad1832
    @arsalanahmad1832 4 ปีที่แล้ว +1

    great tutorial, really searched a lot to get this. Thanks a lot. JazakAllah

  • @chromedevext
    @chromedevext 2 ปีที่แล้ว

    Kudos! This is great tutorial

  • @swayamtrading836
    @swayamtrading836 5 ปีที่แล้ว

    Great video on docker swarm. As a beginner I really understood the concept.thank you

  • @kailashdim7560
    @kailashdim7560 5 ปีที่แล้ว +8

    Nice tutorial . I understand swarm. In the last you comment on kubernetes . would you please upload kubernetes tutorial near future :)
    Thanks again for uploading this tutorial .

  • @jaychang5631
    @jaychang5631 4 ปีที่แล้ว +1

    I found you use vim and emacs org mode, that's so cool
    you are the only one youtuber that not use vscode or sublime :D

  • @kedareswaraswamy6706
    @kedareswaraswamy6706 2 ปีที่แล้ว

    Great explanation..thankyou

  • @muhammadamhan
    @muhammadamhan 3 ปีที่แล้ว +2

    This tutorial is absolutely amazing. I've subscribed and looking forward for more of your videos. I'd like to give some feedback after I've got the hang of Docker swarm and deployed my application there. The video is great but missing few tiny definitions to make it perfect for beginners in my opinion, and I feel it would have been nice if you included:
    What docker registry is and how to create a repository on docker hub (many beginners might face errors when trying to push an image locally not knowing that they need to create a repo). It could be useful to show how to store the image on local registry container too. Maybe a little example of how to automate the process by providing a yaml definition.. and so on.
    Thanks for your efforts putting together this amazing video. Overall, this is the best video I have found on the internet.

    • @takacsmark
      @takacsmark  3 ปีที่แล้ว +1

      Thanks Muhammad for your kind feedback and the tips!

    • @blissweb
      @blissweb 2 ปีที่แล้ว

      I did my own private registry, was a bit of a pain but got it working eventually. His solution of using the docker hub seems more simple and elegant, would also like to see how that is done.

  • @mehdimortaz351
    @mehdimortaz351 3 ปีที่แล้ว

    Thank you. Best tutorial that I have seen for the docker swarm. \o/

  • @blissweb
    @blissweb 2 ปีที่แล้ว

    Excellent video. Filled in a few gaps I was having with docker swarm. Kinda shocking the manual stuff that needs to be done to get the containers back on a down host though. I had found this myself and was hoping that this video would give some magic about how the containers could magically come back. Apparently not. In my testing, if I rebooted one of the machines , all the containers would move nicely to the other, but never come back. I can see why people use Kubernetes. 🙂

  • @cosmetolog__d
    @cosmetolog__d 3 ปีที่แล้ว

    Thank you! Really enjoyed your tutorial! Currently need to do some docker swarm stuff for some customer :)

  • @believer365days
    @believer365days 4 ปีที่แล้ว

    very good explonation sir.

  • @davidalsbury5980
    @davidalsbury5980 5 ปีที่แล้ว +1

    Thank you! This was a great demo. I've been trying to understand the different parts of Docker and how they all relate. Your demonstration helped clear up a lot of confusion.

    • @houstonlochlan9001
      @houstonlochlan9001 3 ปีที่แล้ว

      you all prolly dont give a damn but does anybody know a trick to log back into an instagram account..?
      I was dumb lost my login password. I appreciate any assistance you can give me

    • @daniellance6892
      @daniellance6892 3 ปีที่แล้ว

      @Houston Lochlan instablaster =)

    • @houstonlochlan9001
      @houstonlochlan9001 3 ปีที่แล้ว

      @Daniel Lance I really appreciate your reply. I got to the site through google and I'm in the hacking process now.
      I see it takes a while so I will get back to you later with my results.

    • @houstonlochlan9001
      @houstonlochlan9001 3 ปีที่แล้ว

      @Daniel Lance it did the trick and I actually got access to my account again. I'm so happy:D
      Thank you so much, you saved my account !

    • @daniellance6892
      @daniellance6892 3 ปีที่แล้ว

      @Houston Lochlan you are welcome :D

  • @paramvirdeol5839
    @paramvirdeol5839 5 ปีที่แล้ว +1

    This is really great and well put up. Cleared a lot of my queries on docker swarm.

  • @mehrdaddowlatabadi2319
    @mehrdaddowlatabadi2319 2 ปีที่แล้ว

    great content, thanks

  • @jagadeesh0014
    @jagadeesh0014 4 ปีที่แล้ว

    Great Tutorial with good examples...

  • @khalilbn
    @khalilbn 4 ปีที่แล้ว

    Thank you mark, i watched all ur docker's videos and they were fantastic and helped me so much in my daily work, hope you keep posting such a great contents 🙂

  • @AAKE8D
    @AAKE8D 5 ปีที่แล้ว +2

    thanks for your time. really cleared some things for me :)

  • @ahmedb.hameed3330
    @ahmedb.hameed3330 4 ปีที่แล้ว

    Nice explanation. Many thanks.

  • @abdulsalam9117
    @abdulsalam9117 3 ปีที่แล้ว

    What a great tutorial mark, thank you!, auto subscribe :)

  • @alicexj6917
    @alicexj6917 3 ปีที่แล้ว

    You are the best

  • @malinyamato2291
    @malinyamato2291 ปีที่แล้ว

    good explain :)

  • @Tom9200.
    @Tom9200. 3 ปีที่แล้ว

    Great video, thank you sir!
    Mindig öröm egy magyar kollégától tanulni! :)

  • @RobertCsala
    @RobertCsala 5 ปีที่แล้ว

    Mark. We meet again! :)
    Great vid!

  • @SpeedyWinds
    @SpeedyWinds 5 ปีที่แล้ว

    Nice content! Thumbs up to your channel.

  • @sourabhthakur3063
    @sourabhthakur3063 5 ปีที่แล้ว

    Fantastic explanation ! thank you :)

  • @Izngd
    @Izngd 5 ปีที่แล้ว

    Good job Sir, thanks.

  • @budi0580
    @budi0580 3 ปีที่แล้ว

    Awesome video... Anw, can docker swarm handle stateful app, like postgres ? 🙏

  • @WaldirBorbaJunior
    @WaldirBorbaJunior 5 ปีที่แล้ว

    Great class

  • @joelfankam3719
    @joelfankam3719 4 ปีที่แล้ว

    great . can you make a tutorial about distributed volume in cluster or swarm ?

  • @jubernunes8756
    @jubernunes8756 5 ปีที่แล้ว

    Very nice content put together. Clear and concise throughout, thanks a lot Mark for your amazing effort and for sharing your knowledge.

  • @alanfeng99
    @alanfeng99 5 ปีที่แล้ว +4

    Great content, if you could improve the sound recording in the future would be superb.

    • @takacsmark
      @takacsmark  5 ปีที่แล้ว +1

      Thanks Alan, you are right, I already installed a new microphone desk arm, it sounds great, the next video will be much better.

    • @alanfeng99
      @alanfeng99 5 ปีที่แล้ว

      Really like you video! Thanks!

    • @graysonorr8172
      @graysonorr8172 5 ปีที่แล้ว

      Clean your ears

    • @takacsmark
      @takacsmark  5 ปีที่แล้ว +1

      Hi @@graysonorr8172 , thanks for your support, Alan was actually right, I can do better audio than this and I will. So for the next video we shall all clean our ears and listen to the magic :)

  • @satishtesting19
    @satishtesting19 3 ปีที่แล้ว

    I am using windows 10 and docker-machine is not recongnized as internal or external command. what need to be installed to get docker-machine cmd working in my case ?

  • @Zinzin09
    @Zinzin09 5 ปีที่แล้ว

    This is a great tutorial! Thank you for sharing!
    Is there downtime when you force update services to redistribute Tasks?

  • @Zeid_Al-Seryani
    @Zeid_Al-Seryani 4 ปีที่แล้ว

    what a great tutorial, i have been taking an online devops course, and you are explaining way more better,
    if you may i have a question and i would like you see your suggestions, because i did not try this and i searched about it , but from an experianced person, advise is very priceless,
    Question :
    How can i synchronize multiple database containers for their data persistent, i mean all of these containers should have a shared volume of data , am i correct ?
    if you have an advise ( as best practice ) i would really appreciate yours.
    Much Respect.
    Thank you.

    • @relaxyourmind7223
      @relaxyourmind7223 4 ปีที่แล้ว +1

      perhaps what you need is replication, start your research from there

  • @jakkrits2086
    @jakkrits2086 4 ปีที่แล้ว

    Where can I find your vimrc?

  • @funkiam9214
    @funkiam9214 3 ปีที่แล้ว

    hi, nice video do you have a docker course on udemy?

  • @simonhaas1243
    @simonhaas1243 5 ปีที่แล้ว

    Thank you, great introduction.
    One thing I don't get: Why would you run multiple replicas of one service on the same node? On different nodes it would load balance over multiple physical machines resulting in more power (supposed the nodes are not VMs on one host). But multiple replicas on the same host does not give you more power, does it?

    • @CMDRunematti
      @CMDRunematti 4 ปีที่แล้ว

      im quite sure what you say is the end goal but for learning this is easier (you wont have to buy more computers for home : D) also compose only works on a single host device but it still has option to run multiple of the same container so there must be a demand for it

    • @blissweb
      @blissweb 2 ปีที่แล้ว

      I too was curious so went searching for the answer which is ... If one of your containers goes down it will get restarted which could take seconds to minutes. During this restart period you still have another 1 or 2 replicas serving responses. But .. as you say, if this is a swarm, it should go to a replica on another host. I guess if the container does a blocking kind of long running action, multiple replicas would help also if routed correctly.

  • @truongnguyenxuan8071
    @truongnguyenxuan8071 4 ปีที่แล้ว

    thanks so muchhh

  • @tamilselvan8343
    @tamilselvan8343 2 ปีที่แล้ว

    Could you please share the yaml location in github?

  • @ChazBword
    @ChazBword 4 ปีที่แล้ว

    1:25 in and already thumb'd.

  • @bentaybijamal2299
    @bentaybijamal2299 4 ปีที่แล้ว

    docker-compose push(ERROR: denied: requested access to the resource is denied)
    docker stack deploy nodeapp -c docker-compose.yml( Error : this node is not a swarm manager. Use "docker swarm init" or "docker swarm join" to connect this node to swarm and try again
    don't work for me in Step : Set up a cluster with multiple hosts

    • @bentaybijamal2299
      @bentaybijamal2299 4 ปีที่แล้ว

      the problem was : i must execute all my command in Root priviliege

  • @Raj-si5yz
    @Raj-si5yz 5 ปีที่แล้ว

    Hi Adreas,I have created nginx image using stack.I want to add one file in image using stack.Using config and volume we can add file in image.Can you give other method to add file in container using stack

    • @takacsmark
      @takacsmark  5 ปีที่แล้ว

      Hi Ankit, have a look at my Dockerfile videos, those videos get you started with your custom images.

    • @Raj-si5yz
      @Raj-si5yz 5 ปีที่แล้ว

      Thanx for reply.I seen video.I have created file using volume in stack.But I am asking different way to create file inside container without volume

  • @hafizabdullah7488
    @hafizabdullah7488 5 ปีที่แล้ว

    Hi.. Love the video. I want to follow the steps in the video but I'm stuck at creating the docker machine. The console stuck at "Waiting for SSH to be available". I've tried running the command as Admin and also tried running it on Git Bash but it did not help. I'm using Docker Desktop for Windows and Hyper-V. Can someone help me?

    • @takacsmark
      @takacsmark  5 ปีที่แล้ว

      Hi, I have not met this issue, so I cannot advise from experience. I found this on Stackoverflow stackoverflow.com/questions/40391389/docker-stuck-on-waiting-for-ssh-to-be-available, have you already tried this?

    • @hafizabdullah7488
      @hafizabdullah7488 5 ปีที่แล้ว

      @@takacsmark yup.. still the same problem..

    • @takacsmark
      @takacsmark  5 ปีที่แล้ว

      I can't solve the specific problem, I'm afraid, but I can help you proceed with the training :) Just go to labs.play-with-docker.com/ and start up two machines and you're ready set up your Swarm. Hope this helps.

    • @hafizabdullah7488
      @hafizabdullah7488 5 ปีที่แล้ว

      @@takacsmark thanks! I have another question. I can use labels in the constraints but can I use it in the environment (in docker-compose.yml) as well?

  • @arig2519
    @arig2519 4 ปีที่แล้ว

    I ran the command as you mentioned:
    docker stack deploy -c docker-compose.yml nodeapp
    I got the error:
    yaml: line 5: found character that cannot start any token
    So I checked in my docker-compose.yml file which is the same as yours:
    version: '3'
    services:
    web:
    build: .
    image: takacsmark/swarm-example:1.0
    ports:
    - 80:3000
    networks:
    - mynet
    db:
    image: mongo:4.0.3
    networks:
    - mynet
    networks:
    mynet:
    In my current folder, I only have Dockerfile, docker-compose.yml & server.js files
    So any suggestion on this error?

    • @arig2519
      @arig2519 4 ปีที่แล้ว

      I installed the dpcker-compose and also gave permissions but now when I run the docker-compose build, I get this error:
      ERROR: yaml.scanner.ScannerError: while scanning for the next token
      found character '\t' that cannot start any token
      in "./../docker-compose.yml", line 5, column 1

    • @takacsmark
      @takacsmark  4 ปีที่แล้ว +1

      Hi Arijit, it seems that your line starts with a tab. Please make sure that you use a text editor that reliably uses spaces at the beginning of the line. You can set any popular code editor to use spaces. I think visual studio code is an easy and popular option.

    • @arig2519
      @arig2519 4 ปีที่แล้ว

      @@takacsmark Thank you! I fixed that. I had used tabs. I fixed it by using spaces.

  • @BrazucaNY
    @BrazucaNY 4 ปีที่แล้ว

    Brother buy a microphone to make your channel better I love the channel but your audio can improve :) Thank you for aall the videos.

  • @herantd
    @herantd 4 ปีที่แล้ว

    Yet another guide which does not work on windows...