Top 8 Docker Best Practices for using Docker in Production

Поділитися
Вставка
  • Опубліковано 25 чер 2024
  • 8 Docker Production Best Practices to improve security, reduce the image size and improve build time
    Full Docker course ► • Docker Tutorial for Be...
    Follow me on IG for behind-the-scenes content 😊 ► bit.ly/2F3LXYJ
    ► This video is sponsored by Kasten 🙌🏼
    ► Free Kubernetes Backup and Migration - Download Kasten's K10 and Get 10 nodes free forever: www.kasten.io/nana
    Docker adoption rises constantly, but not everyone is using Docker according to the best practices.
    So in this video I want to show you 8 ways you can use docker in a right way in your projects to improve security, optimize the image size and take advantage of some of the useful Docker features and also write cleaner and more maintainable Dockerfiles.
    ▬▬▬▬▬▬ T I M E S T A M P S ⏰ ▬▬▬▬▬▬
    0:00 - Intro
    0:34 - BP 1: Use official and verified Docker Images as Base Image
    1:13 - BP 2: Use Specific Docker Image Versions
    2:12 - BP 3: Use Small-Sized Official Images
    4:35 - BP 4: Optimize Caching Image Layers
    10:09- BP 5: Use .dockerignore file
    10:55 - BP 6: Make use of Multi-Stage Builds
    14:15 - BP 7: Use the Least Privileged User
    16:06 - BP 8: Scan your Images for Security Vulnerabilities
    17:50 - Wrap Up
    ▬▬▬▬▬▬ Want to learn more? 🚀 ▬▬▬▬▬▬
    Full Docker course ► • Docker Tutorial for Be...
    Full Python course ► • Python Tutorial for Be...
    Full K8s course course ► • Kubernetes Tutorial fo...
    DevOps Tools, like Terraform, Prometheus ► bit.ly/2W9UEq6
    ▬▬▬▬▬▬ Connect with me 👋 ▬▬▬▬▬▬
    INSTAGRAM ► bit.ly/2F3LXYJ
    TWITTER ► bit.ly/3i54PUB
    LINKEDIN ► bit.ly/3hWOLVT
    FB group ► bit.ly/32UVSZP
    DEV ► bit.ly/3h2fqiO
    ▬▬▬▬▬▬ Courses & Bootcamp & Ebooks 🚀 ▬▬▬▬▬▬
    ► Become a DevOps Engineer - full educational program 👉🏼 bit.ly/45mXaer
    ► High-Quality and Hands-On Courses 👉🏼 bit.ly/3BNS8Kv
    ► Kubernetes 101 - compact and easy-to-read ebook bundle 👉🏼 bit.ly/3Ozl28x

КОМЕНТАРІ • 236

  • @TechWorldwithNana
    @TechWorldwithNana  2 роки тому +23

    Full Docker course ► ua-cam.com/video/3c-iBn73dDE/v-deo.html
    Follow me on IG for behind-the-scenes content 😊 ► bit.ly/2F3LXYJ
    ▬▬▬▬▬▬ T I M E S T A M P S ⏰ ▬▬▬▬▬▬
    0:00 - Intro
    0:34 - BP 1: Use official and verified Docker Images as Base Image
    1:13 - BP 2: Use Specific Docker Image Versions
    2:12 - BP 3: Use Small-Sized Official Images
    4:35 - BP 4: Optimize Caching Image Layers
    10:09- BP 5: Use .dockerignore file
    10:55 - BP 6: Make use of Multi-Stage Builds
    14:15 - BP 7: Use the Least Privileged User
    16:06 - BP 8: Scan your Images for Security Vulnerabilities
    17:50 - Wrap Up
    ▬▬▬▬▬▬ Want to learn more? 🚀 ▬▬▬▬▬▬
    Full Docker course ► ua-cam.com/video/3c-iBn73dDE/v-deo.html
    Full Python course ► ua-cam.com/video/t8pPdKYpowI/v-deo.html
    Full K8s course course ► ua-cam.com/video/X48VuDVv0do/v-deo.html
    DevOps Tools, like Terraform, Prometheus ► bit.ly/2W9UEq6
    ▬▬▬▬▬▬ Connect with me 👋 ▬▬▬▬▬▬
    INSTAGRAM ► bit.ly/2F3LXYJ
    TWITTER ► bit.ly/3i54PUB
    LINKEDIN ► bit.ly/3hWOLVT
    FB group ► bit.ly/32UVSZP
    DEV ► bit.ly/3h2fqiO
    ▬▬▬▬▬▬ Courses & Bootcamp & Ebooks 🚀 ▬▬▬▬▬▬
    ► Become a DevOps Engineer - full educational program 👉🏼 bit.ly/3gEwf4V
    ► Ultimate Kubernetes Course (CKA) 👉🏼 bit.ly/k8s-administrator-course
    ► High-Quality and Hands-On Courses 👉🏼 bit.ly/3nIouPW
    ► Kubernetes 101 - compact and easy-to-read ebook bundle 👉🏼 bit.ly/3mPIaiU

    • @udhaykumar9853
      @udhaykumar9853 2 роки тому

      Hello Nana 👋 thanks for sharing 👍

  • @koenbrink
    @koenbrink 2 роки тому +81

    One thing I would like to add about the caching is that it can sometimes screw over your buiild. It is therefore actually advised by Docker to always test your Dockerfile with the --no-cache flag every once in a while (for example with Github Actions or automatated build testing, a good idea would be to use --no-cache) in case you are for example building external files. In that case, a layer like "git clone ..." can be cached, but if the files in that repository change, it will still use the cached layer because the command did not change.
    Great video as always

    • @TechWorldwithNana
      @TechWorldwithNana  2 роки тому +7

      Thanks for sharing!

    • @MateuszCholewka
      @MateuszCholewka 2 роки тому +20

      Good point! The alternative solution is to use the version references, the same as specifying a docker image tag. For example, when you clone something you should specify a tag or commit hash. Same for installing something with apt or apk, you can specify the version of the package. In this case, you need to manually manage to update all your dependencies, but you have more control over that. If you update something, the command will be changed, and docker will rebuild the cache. That will also avoid situations when something works differently for a few developers because some of them use the old cache, and some of them built their images from scratch.

    • @koenbrink
      @koenbrink 2 роки тому +4

      @@MateuszCholewka yep, that would actually be even better. That would also be more inline with the points in this video about 'always specifying a version number'. Thanks for that!

  • @ayencoscolfield3312
    @ayencoscolfield3312 2 роки тому +56

    Always win me over with her charisma ,quality display of intellect and explanations on topical issues, this is another excellent work. Thanks Nana you are easily my champion

  • @pedroansilva
    @pedroansilva 2 роки тому +3

    I love the way you present your content in such a concise, but technically accurate manner. Congratulations and thank you for sharing Nana.

  • @Das_KBob
    @Das_KBob 2 роки тому +91

    I am surprised that nobody mentioned docker secrets and sensitive data in general; You should NOT run commands that have passwords/api tokens as parameters (as they would show up in the history) and you should also NEVER copy sensitive unnecessary files (e.g. certificates for code signing) into an image during build, as people can revert to that layer and get it out of there; mount a host directory instead and read it from there, this way it never ends up in a layer.

    • @TechWorldwithNana
      @TechWorldwithNana  2 роки тому +9

      Thanks for sharing Niklas!

    • @morsikpl
      @morsikpl 2 роки тому +8

      Because Docker Secrets are part of Docker Swarm, and this video is not about Docker Swarm ;)

    • @Das_KBob
      @Das_KBob 2 роки тому +2

      ​@@morsikpl Touché;)

    • @r0zemary
      @r0zemary Рік тому +1

      @@morsikpl Secrets still work in regular compose, just not much of a point compared to mounting them (which *is* what the original comment said, btw 😅)

  • @prayagsingh03
    @prayagsingh03 2 роки тому +1

    The way you explained everything in this video is not just amazing but super easy to understand too. Thank you so much for this wonderful video. You are awesome.

  • @anuragbapat2222
    @anuragbapat2222 2 роки тому

    Thank you Nana! Never missed any of your videos on Docker or Kubernetes. You are one of the best out there!

  • @sachinpandey8003
    @sachinpandey8003 2 роки тому +2

    Another great video!! Always learn a lot from your videos!! You really do a great job of simply explaining core concepts!

  • @rusasd1
    @rusasd1 2 роки тому +1

    Awesome video! I spent tons of hours on the official documentario about caching layers and I couldn't figure out how it works, now you made me understand in three minutes, I love you!

  • @DevTalles
    @DevTalles 2 роки тому +1

    Awesome! Thank you so much!

  • @syskiessistemasit7448
    @syskiessistemasit7448 2 роки тому +1

    Hi Nana!! Your videos are always a huge contribution! The way you detail the topics is fantastic! applause for your channel! At some point it would be good, best practices for docker-compose, you are well nana greetings!

  • @CHITUS
    @CHITUS 2 роки тому +2

    I had no Idea about changes in previous layers breaking the caching of the following layers! Excellent video

  • @JesseSteinfort
    @JesseSteinfort 2 роки тому

    This video is fantastic. The tips go from basic to advanced so don't stop just because it seems like the tips are common sense. I'm in the middle of my docker journey and have one application in production right now. I found these tips to be useful and include things that I need to implement in my existing app and in others in the future. Thank you for this video.

  • @thomash.8297
    @thomash.8297 2 роки тому +8

    Thank you Nana! Perfect like always.

  • @crosticox
    @crosticox 2 роки тому

    Another great and simple digestible topic. You rock

  • @symbally
    @symbally 2 роки тому +1

    Very good recommendations explained concisely; I shared this with my team halfway through watching, love it

  • @alifiroozizamani7782
    @alifiroozizamani7782 2 роки тому +1

    What a awesome tips!
    Thanks a lot nana🙏

  • @sgrhr024
    @sgrhr024 2 роки тому

    Absolute Saviour you are, anything i search n there u have created a video, Thanks you for the time and efforts

  • @royston1928
    @royston1928 2 роки тому +8

    I had no Idea about changes in previous layers breaking the caching of the following layers! Excellent video 👍

  • @iamachs
    @iamachs 2 роки тому

    Amazing work mate, thank you so much for making this video, all the best to you, and Stay Strong!

  • @rtb8085
    @rtb8085 2 роки тому

    Love your videos Nana ... keep them going

  • @IceyBoy47
    @IceyBoy47 2 роки тому +7

    Great video, would love to see others like this one for other technologies

  • @yuriytimerkhanov1228
    @yuriytimerkhanov1228 2 роки тому +1

    This is brilliant, huge thanks 😊

  • @roman445
    @roman445 2 роки тому

    Your videos are excellent, Nana, thanks a lot.

  • @jonnyzheng419
    @jonnyzheng419 2 роки тому

    Great docker usage shareing. Thanks!!!💕💕💕

  • @AfmpJR
    @AfmpJR Місяць тому

    You did it great. Thank you for sharing

  • @soucianceeqdamrashti8175
    @soucianceeqdamrashti8175 2 роки тому

    Great presentation and well explained! Keep it up Nana!

  • @hariprakashpalanisamy923
    @hariprakashpalanisamy923 2 роки тому

    Thank you so much, the video was helpful and informative.

  • @joelamks
    @joelamks 2 роки тому

    Nana always let me learn something really materials. Thanks

  • @jubinben4538
    @jubinben4538 11 місяців тому +1

    Thank you for the easy explaination!

  • @RABWA333
    @RABWA333 2 роки тому

    Thank you Nana , another awsome work

  • @NoDoubt747
    @NoDoubt747 2 роки тому +1

    These are great videos, thank you!!

  • @patriciohernansanchez1148
    @patriciohernansanchez1148 2 роки тому

    Thanks Nana again from Argentina!! Very Helpful content. Regards!

  • @amolsurvase7507
    @amolsurvase7507 2 місяці тому

    Thank you Nana ..!! Best video for docker best practice explanation .

  • @dmitryscherbakov3353
    @dmitryscherbakov3353 2 роки тому

    Thanks a lot! It is very useful for beginners.

  • @ovidiuc4
    @ovidiuc4 2 роки тому +1

    Great video. A similar one for development setup would be awesome.

  • @joncrockettable
    @joncrockettable Рік тому

    This is great. Thank you!

  • @ta2742
    @ta2742 2 роки тому

    Great explanation Nana, thank you!

  • @kayderl
    @kayderl 2 роки тому

    Thanks for sharing. Your channel is an amazing resource.

  • @shaileshsawant3285
    @shaileshsawant3285 2 роки тому +1

    Thanks for sharing best practices

  • @mehdiboujid8761
    @mehdiboujid8761 2 роки тому

    One of the best informative docker videos.

  • @dnzkrblt
    @dnzkrblt 2 роки тому

    Very useful information about Docker. Thank you Nana.

  • @Shubham__Saroj
    @Shubham__Saroj 2 роки тому

    Awesomely explained! Thanks

  • @gadgetkh9408
    @gadgetkh9408 2 роки тому +1

    Great tips! Thank you!

  • @Hackenbaker
    @Hackenbaker Рік тому

    Thanks a lot. This information is very valuable.

  • @ManhPham-fh6on
    @ManhPham-fh6on Рік тому

    excellent explanation for caching layer. Ty!

  • @lossurdo
    @lossurdo 2 роки тому

    Great content! You have good didactics and a very good slides and examples.

  • @ridwan4107
    @ridwan4107 2 роки тому +1

    thanks Nana, really helpful tips for me

  • @hiepvuvan438
    @hiepvuvan438 2 роки тому

    Thank you so much! You helped me a lot with leaning Docker and Kubernetes XD

  • @remyzandwijk
    @remyzandwijk 2 роки тому +8

    Once again, very useful and high-quality content. Thanks Nana!
    I have a question: could you tell us some more about the tools you are using to create these videos? In particular, I am interested in what software you use to create the animations and such.

  • @thuctranvan4630
    @thuctranvan4630 2 роки тому

    Thank you so much. It's very helpful 😍

  • @fayssaldarif5686
    @fayssaldarif5686 2 роки тому

    Thank you very very much, you have the best and the easy content, keep going please.

  • @Amit-qv8cp
    @Amit-qv8cp Місяць тому +1

    Nice explanation 👍

  • @SuMiSc
    @SuMiSc 2 роки тому

    Perfect as usual!

  • @elenaperez6327
    @elenaperez6327 2 роки тому +1

    Great tips, thank you! 😀

  • @zavierrodriguez9236
    @zavierrodriguez9236 2 роки тому

    Great video!!! Thank you!

  • @dimitrisfilippou
    @dimitrisfilippou 9 місяців тому +1

    Thank you so much!

  • @youtubeoneverything4581
    @youtubeoneverything4581 2 роки тому +1

    Informative and detailed❣️

  • @0123anonymous
    @0123anonymous 2 роки тому

    Interesting.. a very useful.. thanks you Nana

  • @artemmatiushenko2595
    @artemmatiushenko2595 2 роки тому

    Very usefull video, thanks!

  • @suassouf
    @suassouf Рік тому

    Awesome. Extremely useful best practices summary. And it is so clearly explained that if you don´t understand it, probably you have to think in changing your career.

  • @tech-daddy
    @tech-daddy 2 роки тому +1

    Great content, thank you!

  • @horvathmilcsi
    @horvathmilcsi 7 місяців тому

    Great lecture thank you for sharing!

  • @hichemd.7441
    @hichemd.7441 2 роки тому +1

    Great video, as always .. 👏

  • @viktorhonchar
    @viktorhonchar 2 роки тому

    Thank you
    Great tutorial

  • @franekborowiec9648
    @franekborowiec9648 Рік тому

    great video! Learned a few things :)

  • @iamaashishpatel
    @iamaashishpatel 2 роки тому

    Simply awesome video!

  • @samucancld
    @samucancld Рік тому

    such a great content, thanks

  • @tdothot1
    @tdothot1 Рік тому

    She is amazing!!! Beautiful and smart!

  • @Lunolux
    @Lunolux Рік тому +1

    very useful video, thanks

  • @handsome_man69
    @handsome_man69 2 роки тому +1

    Thismakes sence. Good thansk

  • @maryellenbowman2738
    @maryellenbowman2738 2 роки тому

    Fantastically presented content.

  • @ciscohaider7068
    @ciscohaider7068 2 роки тому

    @TechWorld with Nana amazing video and the k you for educating us.

  • @garypaulson5202
    @garypaulson5202 2 роки тому +2

    Thanks! This video was really helpful.

  • @orhanfirik
    @orhanfirik 2 роки тому

    Great compilation 👍🏻

  • @omrivol
    @omrivol 2 роки тому +2

    Thanks Nana!

  • @kunalbagwe6091
    @kunalbagwe6091 2 роки тому

    As always, valuable content created. Thank you Nana for making topics so much easy to grasp.
    Will it be possible to create a video on Docker in Docker concept, it will help alot.
    Thanks Once Again.

  • @daryanghandehari6313
    @daryanghandehari6313 2 роки тому +1

    awesome video as always

  • @abdulwahidgul
    @abdulwahidgul 2 роки тому +5

    If we can get the best practices for docker-compose. It will like aged wine and tasty cheese. Great video. You just level up docker game to a whole new level. Thank you

  • @dmitriydiachenko5648
    @dmitriydiachenko5648 2 роки тому

    awesome useful video! thank you

  • @Ninja-Magician
    @Ninja-Magician 10 місяців тому

    Really helpul, nicely explained things,
    Loved the video... :)

  • @blissweb
    @blissweb 2 роки тому

    Excellent info for a newbie like myself. 🙂

  • @alexserbul
    @alexserbul 11 місяців тому

    Thank you!

  • @rodrigoguerra3806
    @rodrigoguerra3806 2 роки тому +1

    I love your content!

  • @Souhib77
    @Souhib77 2 роки тому +1

    Great video Nana, please more video on best practices !! 😊

  • @RishiRaj-ex9wb
    @RishiRaj-ex9wb 2 роки тому +1

    Thanks a lot

  • @user-gx1gf3cl5p
    @user-gx1gf3cl5p 2 роки тому +1

    Thanks Nana ♥

  • @AhmedHabbachi
    @AhmedHabbachi 2 роки тому +2

    I started watching this video with a lot of skepticism, but really great practices and it responded to a lot of my question, even if I was doing some tips I didn't know why it was done like so (as I was basically copy pasting commands) great explanation thanks.

    • @TechWorldwithNana
      @TechWorldwithNana  2 роки тому +1

      Really happy to hear, thanks Ahmed for the feedback! :)

  • @AdnanAmmanUllah
    @AdnanAmmanUllah Рік тому

    course completed,
    thank you Ms Nana.
    please recommend next, I am thinking of Jenkins

  • @Probattu
    @Probattu 2 роки тому

    Nana saving my DevOps Career.

  • @teliat6242
    @teliat6242 2 роки тому +7

    Really good explaination and voice tone 100% clear and perfect.

    • @TechWorldwithNana
      @TechWorldwithNana  2 роки тому +1

      Thanks for the feedback :)

    • @teliat6242
      @teliat6242 2 роки тому

      @@TechWorldwithNana Wish you continuously touch with more and more successful.

  • @mm-wn7fw
    @mm-wn7fw 11 місяців тому

    really great video

  • @kirillpalnitsky3807
    @kirillpalnitsky3807 2 роки тому

    Thank you!!!!

  • @francoisscala417
    @francoisscala417 2 роки тому +2

    And, of course, you can also specify the images versions for a multi-stage build.

  • @Clonel
    @Clonel 2 роки тому

    I liked before watching the video :)

  • @colinschi1001
    @colinschi1001 Рік тому +1

    One quick note. For Image caching you have to use immuteable tags/layers. Otherwise a for example when a cached latest tag is used and never get updated. To be more precise you can also use the layers/image digest instead of a tag.
    @Nana As always: Great videos! :)

  • @rangavembar
    @rangavembar 2 роки тому

    Super it is!!

  • @madhanr5622
    @madhanr5622 2 роки тому

    Thanks Nana for your valuable information sharing 👍. Pls do one video for k8s

  • @fer-ri
    @fer-ri 2 роки тому

    Thanks Nana

  • @CustAndCode
    @CustAndCode 2 роки тому +1

    good tips! 🤗👍