Docker-compose tutorial

Поделиться
HTML-код
  • Опубликовано: 27 июл 2024
  • If you have watched my video about "docker explained simply", we will now have a look at how to easily manage multiple Docker containers with just one simple configuration file. We will deploy a simple web server and database.
    Docker-compose documentation: docs.docker.com/compose/
    Install docker-compose: docs.docker.com/compose/install/
    Follow me:
    TWITTER: / christianlempa
    INSTAGRAM: / christianlempa
    DISCORD: / discord
    GITHUB: github.com/christianlempa
    PATREON: / christianlempa
    MY EQUIPMENT: kit.co/christianlempa
    Timestamps:
    00:00 - Introduction
    01:29 Get started with docker-compose.yaml
    03:29 Versioning in docker-compose files
    04:40 Deploy a simple webserver with docker-compose
    11:30 Add more containers like database
    17:00 Remove all docker containers from docker-compose file
    18:03 Summary
    ----
    All links with "*" are affiliate links.

Комментарии • 102

  • @starryblue4
    @starryblue4 2 года назад +5

    All your video tutorials are so good, you explain all the functions of each line or code, etc.Thank you.

  • @faizmk
    @faizmk 2 года назад +2

    Ive playing with docker for past 1 month. This video definitely had help me understand better what those lines means. Now i know how to create docker compose for docker container that the dev team doesn't provide one. Appreciate your video

  • @mathewkargarzadeh3158
    @mathewkargarzadeh3158 4 года назад +3

    Simple and Understandable docker-compose explanation. Excellent illustration !!. Thanks and gratitude to you !!

  • @deepakjoyjose8189
    @deepakjoyjose8189 Год назад +2

    This is the first time I am watching one of your videos. I loved how you explained the basics of docker compose in such a short amount of time. Thanks a lot for the amazing content!

  • @mohbkhaled6051
    @mohbkhaled6051 Год назад

    This channel is a real discovery thank you for this amazing explanation.

  • @GorkemYildirim
    @GorkemYildirim 3 года назад

    I first used this method after version "3" yaml files were not accepted by portainer stacks without switching to swarm mode. Super useful additional information in this video.

  • @JeanFrancoCaringi
    @JeanFrancoCaringi 4 года назад +1

    Thank you very much!
    Just what I was looking for!
    Gracias!

    • @christianlempa
      @christianlempa  4 года назад

      Thank you! I'm glad it was helpful to you.

  • @robertjyllhed3245
    @robertjyllhed3245 6 месяцев назад

    This was a really great video explaining better than I've seen before. Thank you for sharing and keep sharing. Love your content!

  • @krebs4817
    @krebs4817 3 года назад +12

    need a petition to have this man replace Mr Tiebe

  • @anoopramachandran5197
    @anoopramachandran5197 3 года назад

    Great video! this was really helpful!

  • @jaggyjut
    @jaggyjut 2 года назад

    superb. Thank you for creating this tutorial.

  • @ilya0x
    @ilya0x Год назад

    Awesome videos! Thank you for all your content! Learning Docker with you has been lots of fun :) ...and I'm very jealous of the look of your desktop! That menu up top and that data breach background...love it!

    • @ilya0x
      @ilya0x Год назад

      Could you possibly do a video on how to setup windows to look like yours?🤓

    • @christianlempa
      @christianlempa  Год назад

      Thank you so much!

    • @christianlempa
      @christianlempa  Год назад +1

      I've done some videos, maybe take a look at the YT search :) but as I'm not using windows anymore, there is nothing new I can show :D I'm sorry

  • @kumaryendamuri1599
    @kumaryendamuri1599 2 года назад

    Very understandable explanation.

  • @bikushah9958
    @bikushah9958 2 года назад

    Man,you made it so simple!! Thanks

    • @christianlempa
      @christianlempa  2 года назад

      Glad it helped!

    • @MR-vj8dn
      @MR-vj8dn 6 месяцев назад

      Would you care to explain what it was you found difficult to understand before?

  • @philmennenoh5946
    @philmennenoh5946 4 месяца назад

    Thanks for your time.

  • @jonysnm
    @jonysnm 3 года назад

    Thanks! Great video!

  • @PROGamersf36
    @PROGamersf36 2 года назад

    really good video! thank you !

  • @jordancode
    @jordancode Год назад

    Great video

  • @Ghaleon15
    @Ghaleon15 2 года назад

    Nice video, dude!

  • @sagarnakrani2962
    @sagarnakrani2962 3 года назад +1

    Simple and understandable explanation, actually I was looking for an explanation of "links" in compose file.
    Could you please make another video on installing Magento? It would be really helpful for another developer also.
    Thanks.

    • @christianlempa
      @christianlempa  3 года назад

      Thanks 😊 I will check when I could add this to a video, will take some time. Cheers

  • @ionution2009
    @ionution2009 2 года назад

    Thank you, just beginner, I have more to learning ! :)

  • @vvagw5825
    @vvagw5825 2 года назад

    Спасибо! Ты лучший!

  • @JeanFrancoCaringi
    @JeanFrancoCaringi 4 года назад

    I hope you post more videos about docker compose

    • @christianlempa
      @christianlempa  4 года назад

      Yea, I've planned some more videos about it and also how to deploy them so stay tuned 😁👍

  • @aaronjameshorne
    @aaronjameshorne 3 года назад

    Good video.

  • @linonator
    @linonator 3 года назад +6

    I think the -d is to run the container in Detached mode, so that it runs in the background

  • @beesalniroula6146
    @beesalniroula6146 3 года назад

    thankyou for such a nice and clear tutorial 👍👍 could you please make another video on deploying laravel or any other framework app using dockerfile.

    • @christianlempa
      @christianlempa  3 года назад

      Thank you for the kind words 😀, more docker content is planned, thanks for the good suggestion!

  • @user-wr4yl7tx3w
    @user-wr4yl7tx3w 2 года назад

    Great example

  • @autobahnmensch
    @autobahnmensch Год назад

    Really 😃 great!

  • @hangchen
    @hangchen 3 года назад

    Subscribed!!

  • @haryan1627
    @haryan1627 3 года назад +1

    Great!
    can you share with us with your workspace theme?))

  • @mal-avcisi9783
    @mal-avcisi9783 Год назад

    this guy knows his shiat. bravo !

  • @sanderaerts1178
    @sanderaerts1178 2 года назад

    U the best broo

  • @kribo9604
    @kribo9604 Год назад

    Nice tut, looking for a docker setup for PHP?

  • @SebastianMBraun
    @SebastianMBraun Год назад

    I was looking for some tips how to setup a new network with self-defined IP-addresses with docker compose.

  • @ohiasdxfcghbljokasdjhnfvaw4ehr
    @ohiasdxfcghbljokasdjhnfvaw4ehr 3 года назад

    pywintypes.error: (2, 'CreateFile', 'The system cannot find the file specified.')
    During handling of the above exception, another exception occurred:

  • @mazwenb5783
    @mazwenb5783 3 года назад

    Hi, can I install docker on a subfolder? The main subdomain that my team is using has already installed with Wordpress. So, we want to install a subfolder inside that subdomain. The subfolder will then contains a PHP based application that uses a database. Where to create a database from there? Please let me know. I am new to this. I usually use just basic shared hosting.

  • @user-ui6qh5id2e
    @user-ui6qh5id2e 2 года назад

    Hi, thanks for your videos, they are awesome. I have a question in general about docker-compose...if I want to spin up two different Nextcloud instances that have access to the same database application but different DB names, how would that look? Can I just add this to the compose file with different names?
    Thanks a lot!!

    • @christianlempa
      @christianlempa  2 года назад +2

      Sure, that will work. You need to make sure that both nextcloud instances can connect to the same database and then configure separate databases in the config.

  • @rishiraj2548
    @rishiraj2548 Год назад

    Great

  • @ernesto_quintana
    @ernesto_quintana 3 года назад

    Could you go over the namespaces and cgroups ?

    • @christianlempa
      @christianlempa  3 года назад

      that's a good suggestion to cover it on a future video! I will add this to my backlog 😉

  • @richi_409
    @richi_409 Год назад

    What is the best way to install docker compose?
    I installed docker compose with using the docker repository (docker-compose-plugin), with that method I just get the Version v2.14.1.
    I searched in the docker documentation how to update/upgrade to a newer version, it just says to remove and install the docker-compose-plugin again.
    So how do I get ther Version 3? Is that just possible if you use another method of installing docker compose?

  • @codewithvikasmishra
    @codewithvikasmishra 3 года назад

    May you please elaborate more on docker compose like what is the use of below:-
    Version: '3.7'
    services:
    Jwt_API:
    build:
    Context: .
    dockerfile: Dockerfile
    environment:
    - Any name
    Image: jwt_API:latest
    Container_name: jwt_API
    Volumes:
    - ".:/qbc"
    Ports:
    -"anyport"
    Why we have used build, context, dockerfile, containername etc above.

    • @christianlempa
      @christianlempa  3 года назад

      This is when you want to build your own docker images. I will make some tutorials on that in the future, but I don't know when.

  • @trueskvoz
    @trueskvoz 3 года назад

    hm what about docker-sync ?

  • @mattjacobwilliams1721
    @mattjacobwilliams1721 3 года назад +17

    Ik kijk dit voor besturingssystemen 2,
    Tiebe thanks voor niks zeker?

  • @krishnadasari9863
    @krishnadasari9863 3 года назад

    Hi Chritsian
    how can we build a customized image using docker-compose? I have my dockerfile using docker-compose need to build image

    • @christianlempa
      @christianlempa  3 года назад +1

      You need to specify a "build" attribute that points to the folder of where your Dockerfile and the source files are located

  • @georgetarida5653
    @georgetarida5653 3 года назад

    What OS are you using? Can you make a video about your software setup?

    • @christianlempa
      @christianlempa  3 года назад

      I'm using Windows 10 and yeah I probably will do a video about my complete setup, so thank's for this suggestion :)

  • @madhavimourya1157
    @madhavimourya1157 2 года назад

    Like the background theme,please share the music

  • @CristianMolina
    @CristianMolina 3 года назад

    When you specify version "3" will it use 3.0 or latest "3.x" ?

    • @christianlempa
      @christianlempa  3 года назад +1

      It will always use the latest version you have currently installed, you only need to specify 3.x for backwards compatibility.

  • @rudysal1429
    @rudysal1429 Год назад

    Tabs or spaces , how many do you need per indentation?

    • @christianlempa
      @christianlempa  Год назад

      I'm sure you can use whatever you want, you just need to stick with one scheme.

  • @GamerForeverChannel
    @GamerForeverChannel Год назад

    which os did you use?

  • @SveinWisnaes
    @SveinWisnaes 2 года назад

    Do you need Docker-compose to run a docker container? I managed to get Portainer up and running without installing Docker-compose. Could that be something new?
    Also heard that Kubernetes now comes with a very minimal way of running Docker...

    • @christianlempa
      @christianlempa  2 года назад

      You Don't need docker compose to run containers, it just simplify deploying multiple containers. Kubernetes has their own implementation of a container runtime, they used docker in the past.

    • @crazythings9330
      @crazythings9330 2 года назад

      @@christianlempa right now i'm working as Noc engineer , now i want to pursue devops tools ,can i learn docker and kubernates ,please suggest me tools to crack a job as devops engineer

  • @TradersTradingEdge
    @TradersTradingEdge 2 года назад

    Hi Christian. Thanks for the awesome work you do!
    I followed many of your videos, and they helped me a lot.
    If you have time to answer my question, that would be great, because I can't find a solution for my problem in Docker-Swarm.
    I've installed "Ghost CMS" on Docker Swarm, along with NGINX-Proxy-Manager. Everything works as expected, except the Ghost CMS.
    When I deploy Ghost as a service with multiple instances, I can't login. I get to the login page, put the user & pw and hit enter, and I'l get thrown back to the login screen once again. This does not happen if I deploy Ghost with only 1 instance, either as a service or container. I have a NFS share for the Worker Nodes & the Master, so they can access all the same data of Ghost.
    Do you have any Idea for me Christian? ;-)
    Have a great day and continue your fantastic job here on YT.
    Thanks cheers...

    • @christianlempa
      @christianlempa  2 года назад

      Thank you so much! ;) TBH, I haven't used Docker Swarm before so there is not much I can tell you unfortunately :(

  • @sudhadotsudha
    @sudhadotsudha 2 года назад

    Very Nice , I am trying to create a container with OMV docker images. please suggest

    • @christianlempa
      @christianlempa  2 года назад

      it's hard to find the issue here in the comment section, so why don't you come to our Discord Community, and post some details about your setup, maybe somebody can help you out ;)

    • @sudhadotsudha
      @sudhadotsudha 2 года назад

      @@christianlempa sure, do you have any forum or link to join the discord community

  • @ForrestRhoads
    @ForrestRhoads 3 года назад

    Christian, I think your videos are great, and I enjoy your choice of topics. But why do you caption your channel, "Become an IT Professional?" I am a 71 year old retired lawyer, and I have no interest in becoming an IT Professional. However, I think your tutorials and coverage are great, and I will use many of the things you've taught me on my home network. Vielen Dank für die ausgezeichnete Informationen!

    • @christianlempa
      @christianlempa  3 года назад

      Thank you so much for the kind words 🥰, this is a good question! That's why most of my content is geared towards common IT industry standards and also educates people in what they need in IT jobs. I also want to cover more IT career tips and certs. However, some of my viewers are not working in IT but use this for home lab and projects, which is totally fine and I also want to do more content for home labs as well. But I get it, the caption is something I probably will remove from my branding in the future. Vielen Dank für deine tollen Kommentar!

  • @wtc7862
    @wtc7862 3 года назад

    [docker_entrypoint:crit] [pid 1] DOCKER: mkdir /data/etc: permission denied :D DOCKER ist so GEIL

  • @ohiasdxfcghbljokasdjhnfvaw4ehr
    @ohiasdxfcghbljokasdjhnfvaw4ehr 3 года назад

    dont ask me to subscribe before I've watched your video.

  • @moin6747
    @moin6747 3 года назад

    great video. the lighting in your face looks a bit off

  • @richardfearing4751
    @richardfearing4751 3 года назад +1

    The background music was an issue. I wouldn't recommend playing music during class while the professor is teaching.

    • @rahul_bali
      @rahul_bali 3 года назад

      classical very light music is fine, but not upbeat.

  • @otegaawharitoma5340
    @otegaawharitoma5340 Год назад

    i can hardly see it pls change the back ground

  • @luizgoss
    @luizgoss 3 года назад

    sorry, not works-> sudo: docker-compose: comand not found

    • @christianlempa
      @christianlempa  3 года назад

      You may check out the docu about how to install docker-compose. Alternatively try out installing it via package management.

  • @easyvideott7505
    @easyvideott7505 Год назад

    docker commands should not be run as root user!

  • @SebastianMBraun
    @SebastianMBraun Год назад

    MariaDB > MySQL