Docker Crash Course #5 - The Dockerfile

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 KZread - • 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 KZread - • 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/

Пікірлер: 83

  • @grad_student
    @grad_student29 күн бұрын

    2 years later still so useful.

  • @CoentraDZ
    @CoentraDZ2 жыл бұрын

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

  • @francksgenlecroyant
    @francksgenlecroyant2 жыл бұрын

    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!

  • @SamuelGuebo
    @SamuelGuebo Жыл бұрын

    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!

  • @johnshaff
    @johnshaff Жыл бұрын

    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.

  • @TheFayt11
    @TheFayt112 жыл бұрын

    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 !

  • @donalslemon4947
    @donalslemon49474 ай бұрын

    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.

  • @infinite_sorrow
    @infinite_sorrow5 ай бұрын

    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

  • @Bruno87198
    @Bruno87198 Жыл бұрын

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

  • @NetNinja

    @NetNinja

    Жыл бұрын

    Glad I could help!

  • @tech-networking9287
    @tech-networking92872 жыл бұрын

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

  • @hooman_talakian
    @hooman_talakian Жыл бұрын

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

  • @NetNinja

    @NetNinja

    Жыл бұрын

    Glad it was helpful! Thanks for watching Hooman :)

  • @jejunegamingtv1359
    @jejunegamingtv13592 жыл бұрын

    This is the cleanest, most understandable video of dockerfile

  • @darpananeja6755
    @darpananeja67552 жыл бұрын

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

  • @mykelcee
    @mykelcee Жыл бұрын

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

  • @NetNinja

    @NetNinja

    Жыл бұрын

    Thanks Michael, that means a lot :)

  • @saifmahin7425
    @saifmahin74258 ай бұрын

    Excellent. Thanks a lot for sharing the playlist!

  • @jeremyamon24
    @jeremyamon242 жыл бұрын

    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

    2 жыл бұрын

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

  • @jeremyamon24

    @jeremyamon24

    2 жыл бұрын

    ​@@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

    2 жыл бұрын

    @@jeremyamon24 ok thank you so much

  • @adaoko
    @adaoko Жыл бұрын

    Very clearly explained. Thank you so much!

  • @pourfondeurs
    @pourfondeursАй бұрын

    Perfect tutorials for getting started with Docker

  • @NetNinja

    @NetNinja

    Ай бұрын

    Thanks!!

  • @asaflevy9387
    @asaflevy93872 жыл бұрын

    Excellent explanation! Thank you so much.

  • @stefanocons
    @stefanocons Жыл бұрын

    Amazing course as always! Thank you so much!

  • @NetNinja

    @NetNinja

    Жыл бұрын

    Thanks for watching Stefano!

  • @mikloscsepella2743
    @mikloscsepella27432 жыл бұрын

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

  • @vijaytembugade
    @vijaytembugade2 жыл бұрын

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

  • @abdelkaderkaouane1944
    @abdelkaderkaouane19442 жыл бұрын

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

  • @wenjingwang8735
    @wenjingwang8735 Жыл бұрын

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

  • @NetNinja

    @NetNinja

    Жыл бұрын

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

  • @rey6253
    @rey62532 жыл бұрын

    Very well explained

  • @ZACK-lf4gr
    @ZACK-lf4gr Жыл бұрын

    Thank you for your time and generosity

  • @NetNinja

    @NetNinja

    Жыл бұрын

    Thanks for watching Zack :)

  • @manueljordan317
    @manueljordan317 Жыл бұрын

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

  • @NetNinja

    @NetNinja

    Жыл бұрын

    Thanks Manuel!

  • @praveenpallaganijp236
    @praveenpallaganijp2362 жыл бұрын

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

  • @nuamaaniqbal6373
    @nuamaaniqbal63736 ай бұрын

    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?

  • @colonelvector
    @colonelvector Жыл бұрын

    Excellent tutorial, just excellent

  • @NetNinja

    @NetNinja

    Жыл бұрын

    Appreciate it :) thanks for watching!

  • @maamounmribah4564
    @maamounmribah4564 Жыл бұрын

    amazing

  • @CarlosVixil
    @CarlosVixil11 ай бұрын

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

  • @MuhsinAslan
    @MuhsinAslan2 жыл бұрын

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

  • @JozsefShapasy
    @JozsefShapasy Жыл бұрын

    well done

  • @yossisternlicht21
    @yossisternlicht212 жыл бұрын

    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.

  • @manfredschneider3230
    @manfredschneider32302 ай бұрын

    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
    @VFXTutorials11 ай бұрын

    Great tutorial!

  • @NetNinja

    @NetNinja

    11 ай бұрын

    Thanks!

  • @bluesteel1
    @bluesteel19 ай бұрын

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

  • @springmemory6637
    @springmemory663711 ай бұрын

    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

  • @michakwiatek5031
    @michakwiatek5031 Жыл бұрын

    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.

  • @mohamedyoussef8835
    @mohamedyoussef88352 жыл бұрын

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

  • @Ks-oj6tc
    @Ks-oj6tcКүн бұрын

    Great explanatiion

  • @NetNinja

    @NetNinja

    Күн бұрын

    Glad it was helpful! :)

  • @mh5854
    @mh585419 күн бұрын

    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

  • @anghai9858
    @anghai98588 ай бұрын

    thank you so much

  • @NetNinja

    @NetNinja

    8 ай бұрын

    You're welcome!

  • @SilviuIT-tn3dn
    @SilviuIT-tn3dn7 ай бұрын

    👌👌👌👌

  • @DependerKumarSoni
    @DependerKumarSoni11 ай бұрын

    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?

  • @michalnalevanko6608
    @michalnalevanko66082 жыл бұрын

    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.

  • @keifer7813
    @keifer78138 ай бұрын

    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

  • @stephenodogwu7359
    @stephenodogwu7359 Жыл бұрын

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

  • @apolomoraes1767

    @apolomoraes1767

    Жыл бұрын

    he deleted it on purpose to run node_modules with docker

  • @ms77grz
    @ms77grz8 ай бұрын

    👍👍

  • @digitallizzygaming2099
    @digitallizzygaming2099 Жыл бұрын

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

  • @sulaymanmuhammedjawneh5937
    @sulaymanmuhammedjawneh59372 жыл бұрын

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

  • @reynold99991
    @reynold999912 жыл бұрын

    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

    2 жыл бұрын

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

  • @stevesun1530
    @stevesun15302 жыл бұрын

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

  • @TariqSajid
    @TariqSajid2 жыл бұрын

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

  • @alexanderpoplawski577

    @alexanderpoplawski577

    2 жыл бұрын

    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
    @arthurn89528 ай бұрын

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

  • @MrKaspi097
    @MrKaspi0972 жыл бұрын

    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

    2 жыл бұрын

    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.

  • @thewetfly9207
    @thewetfly9207 Жыл бұрын

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

  • @linearGaming001
    @linearGaming0012 жыл бұрын

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

  • @barcactu1032
    @barcactu10322 ай бұрын

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

  • @akaharrison1644

    @akaharrison1644

    2 ай бұрын

    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

  • @soldadopreciso
    @soldadopreciso2 жыл бұрын

    Please the simple node project isn't in github.

  • @koribr764
    @koribr76410 ай бұрын

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

  • @MyLordHitsHard
    @MyLordHitsHard Жыл бұрын

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