Docker Compose vs Dockerfile - Dockerfile Explained - Docker Tutorial

Поделиться
HTML-код
  • Опубликовано: 15 июл 2024
  • This video is a docker tutorial which explains the two main components of Docker - Docker Compose & Dockerfile (docker compose vs dockerfile).
    This video is part of a series and this series helps you to learn docker from scratch. This series is a docker tutorial for beginners.
    What is a Docker File?
    Docker can build images automatically by reading the instructions from a Dockerfile. A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image.
    In the video we are showing a dockerfile example from which you can learn how to create dockerfile / how to write dockerfile. Dockerfile step by step procedure to create Docker Images from it.
    Commonly Used Dockerfile Commands (Dockerfile Instructions):
    1. FROM
    2. RUN
    3. CMD
    4. ENTRYPOINT
    5. WORKDIR
    6. COPY
    7. ADD
    8. EXPOSE
    9. LABEL
    10. VOLUME
    11. USER
    12. ENV
    13. ARG
    14. ONBUILD
    What is docker compose and what is docker compose used for?
    Docker Compose is a tool to help define and share multi-container applications (introduction to docker compose).
    It’s an important tool for any application that needs multiple microservices, as it allows each service to easily be in a separately managed container.
    How to use Docker Compose?
    We can use a YAML file to configure your application’s services.
    The configuration for a docker compose file is done in docker-compose.yml.
    You don’t need to place this at the root of your project like a Dockerfile. In fact, it can go anywhere, as it doesn’t depend on any other code. However, if you’re building the images locally, it will need to go in a project folder with the code being built.
    In the video you can see how to use docker compose yml file and how to run docker compose file.
    Video Chapters:
    0:00 - Dockerfile Basics
    0:57 - Dockerfile Explained
    3:33 - Dockerfile Commands
    6:08 - Dockerfile Build Container
    10:20 - Introduction to Docker Compose
    11:19 - Docker Compose UP
    #CodingDroplets #Docker

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

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

    ⭐ Join Us on Patreon: www.patreon.com/CodingDroplets
    Microservices Tutorial Playlist Link: ruclips.net/video/gPInkLCfalE/видео.html

  • @AmolGautam
    @AmolGautam 2 года назад +3

    Thank you. The Docker-Compose explanation was spot on.

  • @abhishekbajracharya5646
    @abhishekbajracharya5646 2 года назад +1

    A perfect video for a beginner trying to learn the basics. Thanks a lot.

    • @CodingDroplets
      @CodingDroplets  2 года назад +1

      You are welcome! Glad to know you liked it.

  • @zeusmortegh7538
    @zeusmortegh7538 9 месяцев назад +3

    Your explanation was so clear and understandable.
    Thanks for the tutorial,
    Excellent !

    • @CodingDroplets
      @CodingDroplets  9 месяцев назад

      Thank you so much for your positive feedback! I'm delighted to hear that you found the explanation clear and understandable.

  • @argl1995
    @argl1995 Год назад +4

    I was randomly scrolling couple of videos to get a refresher before my interview and I would say this is one of the best and easiest explanation of Docker. Thanks for saving my time.

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

    the background and the overall explorer theme on 08:30 is of great esthetics, good move!

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

    Extremely helpful thank you.

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

    A Small Token of Appreciation.. 💯 Very nice.. and Excellent Coverage with Good Presentaion and explanation in less time. 👋

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

      So nice of you. Thank you so much for the support ❤

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

    Thank you very much

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

    💯 Very nice.. and Excellent Coverage with Good Presentaion and explanation in less time. 👋

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

    Excellent explanation

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

      Thank you for your comment and feedback! Glad to hear that.

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

    Thank you

  • @afzalkhattak3032
    @afzalkhattak3032 10 месяцев назад +2

    thanks

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

    very nice explained

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

      I'm glad to hear that you found the video helpful and that the explanation was clear. Docker can be a complex topic to understand, so it's always great to receive feedback like this, knowing that my efforts to make the tutorial easy to follow are paying off. Thank you for your support!

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

      @@CodingDroplets keep going. it is awsome tutorial

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

      Thank you for your kind words of support!

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

    Thank you so much for the video, it was very helpful! I was wondering what screen recorder you use because it looks so crisp.

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

      Thank you for your kind words! I'm glad you found the tutorial helpful. I appreciate your compliment on the video quality.
      For screen recording, I use OBS Studio (Open Broadcaster Software). It's a free and open-source software that allows me to capture my screen and create high-quality videos. I find it to be a versatile tool for recording tutorials and demonstrations.
      Thank you again for your feedback, and I'm glad you enjoyed the video!

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

      @@CodingDroplets Thank you very much for the information!

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

    My Raspberry Pi Lite OS runs on a 64GB Micro SD card boot drive and I have a secondary 2TB SSD to store data in. I plan to install Jellyfin and PhotoPrism and NextCloud which requires installing Maria MySQL Data Base. What has me confused is how I specify all docker data storage for PhotoPrism, JellyFin and Nextcloud to take place on the 2TB SSD drive and not the 64GB Micro SD card boot drive? Do you have a video that shows correct docker Volume syntax that enables data to get stored onto a 2TB SSD secondary data drive?

  • @andrewstribling4385
    @andrewstribling4385 6 месяцев назад +1

    How can one determine what should be included in the docker compose file? For example if I want to make a Django website, how do I know what services to include in the file and what keywords to use?

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

      Creating a Docker Compose file for a Django website involves specifying the necessary services, configurations, and dependencies for your application. Determine the main components of your Django application, such as the web server, database, and any additional services. In your Docker Compose file (docker-compose.yml), define each service as a separate block.

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

    If someone don't use user name and password in sql server means use window authentication then what should i write in environment in docker compose ??

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

      Normally I use Linux operating system for sql server container in docker. Why you need windows authentication?

  • @Sriramchandra-rf9fr
    @Sriramchandra-rf9fr 20 дней назад +1

    2:27

    • @CodingDroplets
      @CodingDroplets  15 дней назад

      I'm not quite sure what you're asking. Could you please clarify?

  • @boutheynabiba3437
    @boutheynabiba3437 2 года назад +1

    I wanted to do a connection between mongodb container and hadoop container ... can u help me plz !?

    • @CodingDroplets
      @CodingDroplets  2 года назад +1

      You can place both the containers under the same docker network. So that they can connect each other.
      We'll be covering more about Docker Networking in our upcoming videos.

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

      I did it but i got errors ...i need help plz

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

      Can you please explain about the error you are getting?

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

    Thanks for this 💯!
    When I ran the command : docker-compose up
    I got this error : The system cannot find the file specified: 'C:\\Users\\compose_spec.json'>
    [21308] Failed to execute script docker-compose
    Any help ?

    • @CodingDroplets
      @CodingDroplets  2 года назад +1

      Have you installed docker in your machine? Hope you are using windows operating system.

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

      @@CodingDroplets Thanks for quick reply
      Yeah, I ve installed Docker Desktop and Yes it is Windows 10

    • @CodingDroplets
      @CodingDroplets  2 года назад +1

      You are welcome! Normally docker compose will get installed along with docker desktop in windows. Please have a look on the below URL.
      docs.docker.com/desktop/windows/install/

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

      @@CodingDroplets Actually, I ve installed by following instructions on it

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

      @@CodingDroplets Fun fact, I ve tried to launch the command without launching Docker Desktop but got the same error while I was expecting a different one based on Docker Desktop Services ain't launched !
      😥 Whyyyy?

  • @MRAMetharam
    @MRAMetharam 2 года назад +1

    Nice! Would have been even better if you showed how to re-deploy updates or clean stuff up when you no longer need them. Still very informative. Thanx!!!

    • @CodingDroplets
      @CodingDroplets  2 года назад +1

      Thank You for your valuable feedback.
      This video is part of a series named Microservice Architecture.
      ruclips.net/p/PLzewa6pjbr3JQKhB_U_FiuYwQC70i-TyU
      We have already explained how to remove containers, images etc in other videos. Will be uploading videos about more advanced things soon.

  • @jacekpierzchaa9370
    @jacekpierzchaa9370 9 месяцев назад +1

    Hello, it is a great tutorial butwhen running command :"docker build -t sample-img ." I got stuck on the following issue :
    PS C:\Users\jacek\source
    epos\DockerFileSample> docker build -t sample-img .
    [+] Building 0.2s (2/2) FINISHED docker:default
    => [internal] load .dockerignore 0.0s
    => => transferring context: 2B 0.0s
    => [internal] load build definition from Dockerfile 0.1s
    => => transferring dockerfile: 2B 0.0s
    ERROR: failed to solve: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount3142463899/Dockerfile: no such file or directory

    • @CodingDroplets
      @CodingDroplets  9 месяцев назад

      I'm sorry to hear you're facing an issue. It looks like there might be a problem with the path or context when running the docker build command.
      Ensure that you are running the command from the correct directory where your Dockerfile is located. If your Dockerfile is in a different directory, you can specify the path explicitly.
      docker build -t sample-img path/to/your/Dockerfile-directory

    • @jacekpierzchaa9370
      @jacekpierzchaa9370 9 месяцев назад

      it was my stupid mistake. I have added .txt extension :)@@CodingDroplets