Docker Crash Course #5 - The Dockerfile

Sdílet
Vložit
  • čas přidán 7. 02. 2022
  • Hey gang, in this Docker tutorial we'll talk about the Dockerfile and how we use it to create docker images.
    🐱‍💻 Access the course files on GitHub:
    github.com/iamshaunjp/docker-...
    🐱‍💻 Node.js Course:
    On Net Ninja Pro - netninja.dev/p/node-js-crash-...
    On CZcams - • Node JS Tutorial for B...
    🐱‍💻 Modern JavaScript Course:
    On Net Ninja Pro - netninja.dev/p/modern-javascr...
    On Udemy - www.thenetninja.co.uk/udemy/m...
    On CZcams - • Modern JavaScript Tuto...
    🐱‍💻 React Course:
    On Net Ninja Pro - netninja.dev/p/build-websites...
    On Udemy - www.thenetninja.co.uk/udemy/r...
    🐱‍💻 VS Code - code.visualstudio.com/
    🐱‍💻 Docker Hub - hub.docker.com/
    🐱‍💻 Docker docs - docs.docker.com/

Komentáře • 82

  • @grad_student
    @grad_student Před 12 dny +2

    2 years later still so useful.

  • @SamuelGuebo
    @SamuelGuebo Před rokem +22

    I love your Docker series. Your teaching style is clear, straight to the point, and very methodical.
    Thanks for the time and efforts you've put into this. Really appreciate it!

  • @CoentraDZ
    @CoentraDZ Před 2 lety +5

    This is the most clear explanation I ever seen at CZcams for Docker.
    All other videos I watched before in other channels they just explain like they are robots.

  • @francksgenlecroyant
    @francksgenlecroyant Před 2 lety +20

    The greatest explanation about Dockerfile. I was typing things in this file just for the sake of typing because i saw it working in a tutorial, but from now on, i know what each and every single layer mean. Thanks Shaun!

  • @infinite_sorrow
    @infinite_sorrow Před 4 měsíci +1

    finally someone that takes the time to actually explain the syntax while they go along.......the structure of the language is critical in order to learn, yet so few actually tell you what you are doing, they just tell you enter this blah de blah enter that yada yada. Thanks man i was going crazy trying to find something that gave me a clue lol

  • @johnshaff
    @johnshaff Před rokem +10

    You have your dependencies installed after the source code in your example docker file. Docker caches layers, and by installing dependencies before copying the source code, you can leverage this cache mechanism. If the dependencies don't change often, Docker can reuse the cached layer with the installed dependencies, which speeds up the build process. By installing dependencies after copying the source code, the cache will be invalidated whenever your source code changes, even if the dependencies remain the same. This leads to longer build times.

  • @Bruno87198
    @Bruno87198 Před rokem +3

    I'm so grateful for people like you in the CZcams! I just needed to review the Docker's main concepts and this series is helping a lot! Thank you!

  • @TheFayt11
    @TheFayt11 Před 2 lety +2

    thank you so much for this mr shaun ! you really helped me with my work. i really cannot understand docker for a long time but you explain it so simple and clean ! Thank you, keep it up mr Shaun !

  • @mykelcee
    @mykelcee Před rokem +2

    I've watched multiple tutorial about Docker only you could explain this clearly. keep going (y)

    • @NetNinja
      @NetNinja  Před rokem

      Thanks Michael, that means a lot :)

  • @donalslemon4947
    @donalslemon4947 Před 4 měsíci

    This was exactly what I needed, thank you and well done. Clearly explained, with specific elucidation of the command usage and meanings. I'll be checking out the rest of the videos in this series as I still have questions around the 'AS base' and 'AS build' modifiers as well as how 'ENTRYPOINT' works.

  • @pourfondeurs
    @pourfondeurs Před 27 dny

    Perfect tutorials for getting started with Docker

  • @tech-networking9287
    @tech-networking9287 Před 2 lety

    Thank you! This is the best explanation by far I've seen, I'm confused for couple days.

  • @hooman_talakian
    @hooman_talakian Před rokem

    I have seen many long and boring Docker tutorials, but this one! Amazing. you made my day. thank you a lot ...❤❤

    • @NetNinja
      @NetNinja  Před rokem +1

      Glad it was helpful! Thanks for watching Hooman :)

  • @jejunegamingtv1359
    @jejunegamingtv1359 Před 2 lety

    This is the cleanest, most understandable video of dockerfile

  • @darpananeja6755
    @darpananeja6755 Před 2 lety

    Didnt realise the upload date of the video untli I reached the end!!
    Eagerly waiting for further parts!!!!

  • @adaoko
    @adaoko Před rokem

    Very clearly explained. Thank you so much!

  • @jeremyamon24
    @jeremyamon24 Před 2 lety +1

    I just bought this as my first course on your website because not only that I want to access the rest of the course now, but I feel that should since I've been freelancing for the past year now thanks to your videos. Thank you!

    • @user-fv3vf5wo9p
      @user-fv3vf5wo9p Před 2 lety

      Hello
      When you bought the course, did you pay it one time or it monthly fees?

    • @jeremyamon24
      @jeremyamon24 Před 2 lety

      ​@@user-fv3vf5wo9p I paid one time for the docker course only, though there is also a monthly/yearly plan if you want

    • @user-fv3vf5wo9p
      @user-fv3vf5wo9p Před 2 lety

      @@jeremyamon24 ok thank you so much

  • @asaflevy9387
    @asaflevy9387 Před 2 lety

    Excellent explanation! Thank you so much.

  • @saifmahin7425
    @saifmahin7425 Před 8 měsíci

    Excellent. Thanks a lot for sharing the playlist!

  • @nuamaaniqbal6373
    @nuamaaniqbal6373 Před 5 měsíci

    I was waiting for someone like you to make a course on Docker! Here we are ! Next is Kubernetes ! When are you going to do the honor?

  • @stefanocons
    @stefanocons Před rokem

    Amazing course as always! Thank you so much!

    • @NetNinja
      @NetNinja  Před rokem

      Thanks for watching Stefano!

  • @abdelkaderkaouane1944
    @abdelkaderkaouane1944 Před 2 lety

    You are amazing, thank you very much for sharing this good things

  • @mikloscsepella2743
    @mikloscsepella2743 Před 2 lety +1

    so clear. you are so special in that you are able to make every subject simply understandable.

  • @wenjingwang8735
    @wenjingwang8735 Před rokem

    Thanks so much for your video. It's so helpful for me. Your explanation is easy to understand.

    • @NetNinja
      @NetNinja  Před rokem

      That's great to hear :) glad it's helpful

  • @rey6253
    @rey6253 Před 2 lety

    Very well explained

  • @vijaytembugade
    @vijaytembugade Před 2 lety

    I am just willing to all course now!! I cant stop myself.
    😀

  • @ZACK-lf4gr
    @ZACK-lf4gr Před rokem

    Thank you for your time and generosity

    • @NetNinja
      @NetNinja  Před rokem +1

      Thanks for watching Zack :)

  • @manueljordan317
    @manueljordan317 Před rokem

    An excellent tutorial - well explained Mr Ninja - a cold beer to you ...

  • @yossisternlicht21
    @yossisternlicht21 Před 2 lety

    Great tutorial as usual. One point, what will happen if we change package.json to reference a new dependency, will the previous version get installed from the cache? This could be a big issue.

  • @CarlosVixil
    @CarlosVixil Před 11 měsíci

    I wish this video played anytime anyone ever mentioned docker. then it wouldn't be so mysterious and overwhelming.

  • @colonelvector
    @colonelvector Před rokem

    Excellent tutorial, just excellent

    • @NetNinja
      @NetNinja  Před rokem +1

      Appreciate it :) thanks for watching!

  • @manfredschneider3230
    @manfredschneider3230 Před měsícem

    thanks for the free presentation.
    BUT .. often recomended - and only where it is possible:
    I would appreciate a much larger, more noticeable, maybe colored pointer/cursor, moved with a calm hand to allow me following more easily your brilliant thoughts.

  • @VFXTutorials
    @VFXTutorials Před 10 měsíci

    Great tutorial!

  • @maamounmribah4564
    @maamounmribah4564 Před rokem

    amazing

  • @JozsefShapasy
    @JozsefShapasy Před 11 měsíci

    well done

  • @praveenpallaganijp236
    @praveenpallaganijp236 Před 2 lety

    I am so much thankful to this channel, thank you ninja 🙂

  • @MuhsinAslan
    @MuhsinAslan Před 2 lety

    Hey ninja, you all right? your breath is a little sick. Thank you for docker playlist :)

  • @mh5854
    @mh5854 Před dnem

    In laravel there is a package by names of laravel sail that will write the docker-compose file automatically for the project. hope u make some tutorials about laravel too

  • @springmemory6637
    @springmemory6637 Před 11 měsíci

    WORKDIR - specifies where the commands should run
    RUN commands are run at image build time. This means commands that we want to actually be executed on runtime should be added in CMD

  • @keifer7813
    @keifer7813 Před 7 měsíci +1

    9:00 Does WORKDIR create an "app" folder if it doesnt already exist? Since you said image file structure is completely different to a project's file strcuture

  • @michalnalevanko6608
    @michalnalevanko6608 Před 2 lety

    May I ask? Shouldnt we use the first parameter of command COPY with 2 dots to specify root directory where all the files are stored? As our working directory is /app already.

  • @anghai9858
    @anghai9858 Před 8 měsíci

    thank you so much

  • @DependerKumarSoni
    @DependerKumarSoni Před 10 měsíci +1

    You said, every line after "WORKDIR: /app" would run in /app directory. Then while executing the COPY statement, would not it take source as /app. Which means, copy all from /app to /app?

  • @bluesteel1
    @bluesteel1 Před 9 měsíci

    Please create a k8s series as well i love you style of teaching

  • @mohamedyoussef8835
    @mohamedyoussef8835 Před 2 lety

    Awesome tutorials ++++++++++++++++++++++++++++ Thank you.

  • @stephenodogwu7359
    @stephenodogwu7359 Před rokem

    Nice one as always.A little confusion though where are your node_modules from express js installation

    • @apolomoraes1767
      @apolomoraes1767 Před rokem

      he deleted it on purpose to run node_modules with docker

  • @michakwiatek5031
    @michakwiatek5031 Před rokem

    I think the order of commands should be different to speed up rebuilding image.
    I would first copy packages.json into /app, then run npm instal, and finally copy the rest of the app files. Thanks to that approach, after modifying something in app files, reinstall of npm packages won't be necessary. Small caveat: It requires to set up volume to be able to develop our app locally without need for rebuilding.

  • @digitallizzygaming2099
    @digitallizzygaming2099 Před 11 měsíci

    With the port number is this standard for docker or can it be assigned any number?

  • @reynold99991
    @reynold99991 Před 2 lety

    does the github link always default to the main repository with readme file in the youtube videodescription or is it possible to change it to the other repositories like lesson 5 which contain the files shown in video

    • @202prince1
      @202prince1 Před rokem

      You need to change the branch to access respective lesson files. Like change the branch from main to lesson-5 for lesson 5 files.

  • @SilviuIT-tn3dn
    @SilviuIT-tn3dn Před 6 měsíci

    👌👌👌👌

  • @stevesun1530
    @stevesun1530 Před 2 lety

    didnt see api file on the links, can you show me where is it?

  • @ms77grz
    @ms77grz Před 7 měsíci

    👍👍

  • @TariqSajid
    @TariqSajid Před 2 lety

    what about file permission in docker ? how to create user inside docker for logs permissions

    • @alexanderpoplawski577
      @alexanderpoplawski577 Před 2 lety +1

      All commands during image build and in the container are executed as root. Since the base image is a linux system, you can run commands to add a user and switch to that user in subsequent commands in the Dockerfile. I am pretty sure all this will be explained in more detail during the course. Be patient!

  • @arthurn8952
    @arthurn8952 Před 8 měsíci

    Where do i open the lesson 5 at? Help, i'm a Dummy

  • @MrKaspi097
    @MrKaspi097 Před 2 lety

    What if I need to install global package from that node version at specific version and use it in cmd?
    Eg I need cordova@10 (11 is latest) and use 'cordova build' command?
    What if I change sth in code? Do I need tk build it again? I'm guessing yes, asking to be sure.

    • @alexanderpoplawski577
      @alexanderpoplawski577 Před 2 lety

      Just add a RUN npm install -g cordova@10 to the Dockerfile. After that you can add RUN cordova build. Yes, if you change something in the Dockerfile or the content, that goes into the image you have to build again. There is an alternative with volumes, but I think Shawn will address this in the following parts.

  • @barcactu1032
    @barcactu1032 Před 2 měsíci

    I did not understand how can you COPY . . And get the /api content into /app

    • @akaharrison1644
      @akaharrison1644 Před měsícem

      In my own understanding is that, he create a dockerfile in same directory with dependencies and app.js, that's why he runs the command COPY . . which the first "." represent the relative directory that all of them are located then the second "." is telling the command to save everything in the "WORKDIR /app" created

  • @sulaymanmuhammedjawneh5937

    How i am loving and appreciating this can't be containerized

  • @linearGaming001
    @linearGaming001 Před 2 lety +1

    Where's the source file? I can't find it without paying.

  • @Bismuth-ig5ru
    @Bismuth-ig5ru Před 2 měsíci

    I thought Docker is chaotic.

  • @thewetfly9207
    @thewetfly9207 Před rokem

    I waited for app directory in the tree... but it has been stored in the other dimension xd

  • @soldadopreciso
    @soldadopreciso Před 2 lety

    Please the simple node project isn't in github.

  • @koribr764
    @koribr764 Před 9 měsíci

    Isn't it a bit too fast for beginners?!

  • @MyLordHitsHard
    @MyLordHitsHard Před rokem

    takes so much time on
    RUN npm install
    after 397 seconds it fails