Top 8 Docker Best Practices for using Docker in Production

  Рет қаралды 316,710

TechWorld with Nana

TechWorld with Nana

Күн бұрын

Пікірлер: 242
@TechWorldwithNana
@TechWorldwithNana 3 жыл бұрын
Full Docker course ► kzbin.info/www/bejne/aZSQmnWkbJiXeqc 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 ► kzbin.info/www/bejne/aZSQmnWkbJiXeqc Full Python course ► kzbin.info/www/bejne/qmnTgZeBjtWiras Full K8s course course ► kzbin.info/www/bejne/jmWbh6h6i9tjmtE 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 3 жыл бұрын
Hello Nana 👋 thanks for sharing 👍
@mehdin2222
@mehdin2222 5 ай бұрын
There is no way that I can appreciate what you have done here. These free courses for Docker and other things cost thousands of dollars.
@garypaulson5202
@garypaulson5202 2 жыл бұрын
Thanks! This video was really helpful.
@TechWorldwithNana
@TechWorldwithNana 2 жыл бұрын
Thank you Gary!
@koenbrink
@koenbrink 3 жыл бұрын
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 3 жыл бұрын
Thanks for sharing!
@MateuszCholewka
@MateuszCholewka 3 жыл бұрын
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 3 жыл бұрын
@@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 3 жыл бұрын
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
@TechWorldwithNana
@TechWorldwithNana 3 жыл бұрын
Thanks so much for your nice words!
@pedroansilva
@pedroansilva 3 жыл бұрын
I love the way you present your content in such a concise, but technically accurate manner. Congratulations and thank you for sharing Nana.
@kepplerdottk
@kepplerdottk 2 жыл бұрын
Thanks!
@TechWorldwithNana
@TechWorldwithNana 2 жыл бұрын
Thanks Felix!
@anuragbapat2222
@anuragbapat2222 3 жыл бұрын
Thank you Nana! Never missed any of your videos on Docker or Kubernetes. You are one of the best out there!
@rusasd1
@rusasd1 2 жыл бұрын
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!
@thomash.8297
@thomash.8297 3 жыл бұрын
Thank you Nana! Perfect like always.
@TechWorldwithNana
@TechWorldwithNana 3 жыл бұрын
Thanks so much Tom!
@Das_KBob
@Das_KBob 3 жыл бұрын
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 3 жыл бұрын
Thanks for sharing Niklas!
@morsikpl
@morsikpl 3 жыл бұрын
Because Docker Secrets are part of Docker Swarm, and this video is not about Docker Swarm ;)
@Das_KBob
@Das_KBob 3 жыл бұрын
​@@morsikpl Touché;)
@r0zemary
@r0zemary 2 жыл бұрын
@@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 3 жыл бұрын
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.
@royston1928
@royston1928 3 жыл бұрын
I had no Idea about changes in previous layers breaking the caching of the following layers! Excellent video 👍
@sgrhr024
@sgrhr024 3 жыл бұрын
Absolute Saviour you are, anything i search n there u have created a video, Thanks you for the time and efforts
@fernando_her85
@fernando_her85 3 жыл бұрын
Awesome! Thank you so much!
@teliat6242
@teliat6242 3 жыл бұрын
Really good explaination and voice tone 100% clear and perfect.
@TechWorldwithNana
@TechWorldwithNana 3 жыл бұрын
Thanks for the feedback :)
@teliat6242
@teliat6242 3 жыл бұрын
@@TechWorldwithNana Wish you continuously touch with more and more successful.
@sachinpandey8003
@sachinpandey8003 3 жыл бұрын
Another great video!! Always learn a lot from your videos!! You really do a great job of simply explaining core concepts!
@IceyBoy47
@IceyBoy47 3 жыл бұрын
Great video, would love to see others like this one for other technologies
@TechWorldwithNana
@TechWorldwithNana 3 жыл бұрын
Thanks for your comment, good to know! :)
@JesseSteinfort
@JesseSteinfort 3 жыл бұрын
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.
@patriciohernansanchez1148
@patriciohernansanchez1148 3 жыл бұрын
Thanks Nana again from Argentina!! Very Helpful content. Regards!
@mehdiboujid8761
@mehdiboujid8761 3 жыл бұрын
One of the best informative docker videos.
@symbally
@symbally 3 жыл бұрын
Very good recommendations explained concisely; I shared this with my team halfway through watching, love it
@andy5627
@andy5627 3 жыл бұрын
I think another best practice good to mention is to minimize the number of layers, for example instead of write multiple `RUN` instructions which created multiple layers, we can write a single `RUN` instruction with the necessary commands by concat it with && or even backslash `\` to decorate the Dockerfile for better readability.
@nathanlewis42
@nathanlewis42 3 жыл бұрын
Wouldn’t that mess less effective caching? If you had three commands anded together and only the last need to change you would not have a cache of the previous two.
@berndeckenfels
@berndeckenfels 3 жыл бұрын
@@nathanlewis42 yes, it’s probably better to not use it in the build step and only in the run image if the missing cache Is a tradeoff (depends on how often you change a image and how many copy’s are distributed)
@Probattu
@Probattu 3 жыл бұрын
Nana saving my DevOps Career.
@amolsurvase7507
@amolsurvase7507 9 ай бұрын
Thank you Nana ..!! Best video for docker best practice explanation .
@abdulwahidgul
@abdulwahidgul 3 жыл бұрын
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
@joelamks
@joelamks 3 жыл бұрын
Nana always let me learn something really materials. Thanks
@suassouf
@suassouf 2 жыл бұрын
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.
@rishiraj2548
@rishiraj2548 6 ай бұрын
Timeless! thanks, Nana.
@dnzkrblt
@dnzkrblt 3 жыл бұрын
Very useful information about Docker. Thank you Nana.
@jubinben4538
@jubinben4538 Жыл бұрын
Thank you for the easy explaination!
@NoDoubt747
@NoDoubt747 2 жыл бұрын
These are great videos, thank you!!
@alifiroozizamani7782
@alifiroozizamani7782 3 жыл бұрын
What a awesome tips! Thanks a lot nana🙏
@crosticox
@crosticox 3 жыл бұрын
Another great and simple digestible topic. You rock
@AhmedHabbachi
@AhmedHabbachi 3 жыл бұрын
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 3 жыл бұрын
Really happy to hear, thanks Ahmed for the feedback! :)
@ridwan4107
@ridwan4107 3 жыл бұрын
thanks Nana, really helpful tips for me
@Souhib77
@Souhib77 3 жыл бұрын
Great video Nana, please more video on best practices !! 😊
@TechWorldwithNana
@TechWorldwithNana 3 жыл бұрын
Thanks for your feedback, glad to hear! :)
@noblenetdk
@noblenetdk 5 ай бұрын
I love the video. You might mention "FROM scratch" to keep the docker image slim.
@syskiessistemasit7448
@syskiessistemasit7448 3 жыл бұрын
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!
@rtb8085
@rtb8085 3 жыл бұрын
Love your videos Nana ... keep them going
@AdnanAmmanUllah
@AdnanAmmanUllah 2 жыл бұрын
course completed, thank you Ms Nana. please recommend next, I am thinking of Jenkins
@jonnyzheng419
@jonnyzheng419 3 жыл бұрын
Great docker usage shareing. Thanks!!!💕💕💕
@remyzandwijk
@remyzandwijk 3 жыл бұрын
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.
@andriyun
@andriyun 3 жыл бұрын
One of the most popular practice to reduce a size of a layer is deleting cache files the package managers generates during installation process.
@yuriytimerkhanov1228
@yuriytimerkhanov1228 3 жыл бұрын
This is brilliant, huge thanks 😊
@tdothot1
@tdothot1 2 жыл бұрын
She is amazing!!! Beautiful and smart!
@soucianceeqdamrashti8175
@soucianceeqdamrashti8175 3 жыл бұрын
Great presentation and well explained! Keep it up Nana!
@iamachs
@iamachs 3 жыл бұрын
Amazing work mate, thank you so much for making this video, all the best to you, and Stay Strong!
@lossurdo
@lossurdo 3 жыл бұрын
Great content! You have good didactics and a very good slides and examples.
@daryanghandehari6313
@daryanghandehari6313 3 жыл бұрын
awesome video as always
@Felipe-u4m
@Felipe-u4m 3 жыл бұрын
Thanks Nana ♥
@hiepvuvan438
@hiepvuvan438 3 жыл бұрын
Thank you so much! You helped me a lot with leaning Docker and Kubernetes XD
@shaileshsawant3285
@shaileshsawant3285 3 жыл бұрын
Thanks for sharing best practices
@RABWA333
@RABWA333 3 жыл бұрын
Thank you Nana , another awsome work
@rodrigoguerra3806
@rodrigoguerra3806 3 жыл бұрын
I love your content!
@orhanfirik
@orhanfirik 3 жыл бұрын
Great compilation 👍🏻
@francoisscala417
@francoisscala417 3 жыл бұрын
And, of course, you can also specify the images versions for a multi-stage build.
@kayderl
@kayderl 3 жыл бұрын
Thanks for sharing. Your channel is an amazing resource.
@Shuubham_Harilal_Saroj
@Shuubham_Harilal_Saroj 2 жыл бұрын
Awesomely explained! Thanks
@gadgetkh9408
@gadgetkh9408 3 жыл бұрын
Great tips! Thank you!
@fadidev3383
@fadidev3383 3 жыл бұрын
Very basics, every dockeist knows this!
@ManhPham-fh6on
@ManhPham-fh6on 2 жыл бұрын
excellent explanation for caching layer. Ty!
@fayssaldarif5686
@fayssaldarif5686 3 жыл бұрын
Thank you very very much, you have the best and the easy content, keep going please.
@roman445
@roman445 3 жыл бұрын
Your videos are excellent, Nana, thanks a lot.
@CustAndCode
@CustAndCode 3 жыл бұрын
good tips! 🤗👍
@hichemd.7441
@hichemd.7441 3 жыл бұрын
Great video, as always .. 👏
@Hackenbaker
@Hackenbaker Жыл бұрын
Thanks a lot. This information is very valuable.
@thuctranvan4630
@thuctranvan4630 3 жыл бұрын
Thank you so much. It's very helpful 😍
@omrivol
@omrivol 3 жыл бұрын
Thanks Nana!
@SuMiSc
@SuMiSc 3 жыл бұрын
Perfect as usual!
@umarsadiqi404
@umarsadiqi404 Жыл бұрын
Really helpul, nicely explained things, Loved the video... :)
@ovidiuc4
@ovidiuc4 3 жыл бұрын
Great video. A similar one for development setup would be awesome.
@joncrockettable
@joncrockettable 2 жыл бұрын
This is great. Thank you!
@Lunolux
@Lunolux Жыл бұрын
very useful video, thanks
@youtubeoneverything4581
@youtubeoneverything4581 3 жыл бұрын
Informative and detailed❣️
@dmitryscherbakov3353
@dmitryscherbakov3353 3 жыл бұрын
Thanks a lot! It is very useful for beginners.
@Clonel
@Clonel 3 жыл бұрын
I liked before watching the video :)
@ciscohaider7068
@ciscohaider7068 3 жыл бұрын
@TechWorld with Nana amazing video and the k you for educating us.
@AfmpJR
@AfmpJR 9 ай бұрын
You did it great. Thank you for sharing
@Amit-qv8cp
@Amit-qv8cp 8 ай бұрын
Nice explanation 👍
@0123anonymous
@0123anonymous 3 жыл бұрын
Interesting.. a very useful.. thanks you Nana
@DrLaddu2
@DrLaddu2 3 жыл бұрын
Thank you so much, the video was helpful and informative.
@artemmatiushenko2595
@artemmatiushenko2595 2 жыл бұрын
Very usefull video, thanks!
@franekborowiec9648
@franekborowiec9648 2 жыл бұрын
great video! Learned a few things :)
@ta2742
@ta2742 3 жыл бұрын
Great explanation Nana, thank you!
@madhanr5622
@madhanr5622 3 жыл бұрын
Thanks Nana for your valuable information sharing 👍. Pls do one video for k8s
@jimfilippou
@jimfilippou Жыл бұрын
Thank you so much!
@fauzifauzi2129
@fauzifauzi2129 3 жыл бұрын
Hi Nana, could you do best practice in using docker for non development purpose, more into administration jobs, like what is the best practice in volume management, updating image, how to transfer volume between hosts, etc.??
@exaucae
@exaucae 3 жыл бұрын
I second the best practice 2. We had CI broken because our Dockerfile did not have a tag, node 17 broke it due to a well known issue. We rolled back to previous versions.
@TechWorldwithNana
@TechWorldwithNana 3 жыл бұрын
Yes, fixing the versions is really important. Thanks for sharing your experience!
@Teruroom
@Teruroom 3 жыл бұрын
動画のご提供ありがとうざいます!大変わかりやすく、かつ、役に立ちました。これからもどうかよろしくお願いいたします。
@maryellenbowman2738
@maryellenbowman2738 3 жыл бұрын
Fantastically presented content.
@TomTrval
@TomTrval 3 жыл бұрын
2nd - addition: freeze version i production stage. BUT use latest in dev env - you can detect compatibility problems early on dev stage
@horvathmilcsi
@horvathmilcsi Жыл бұрын
Great lecture thank you for sharing!
@iamaashishpatel
@iamaashishpatel 3 жыл бұрын
Simply awesome video!
@viktorhonchar
@viktorhonchar 3 жыл бұрын
Thank you Great tutorial
@lukeanglin263
@lukeanglin263 3 жыл бұрын
This channel is a gem. You're so good at this Nana. DO you speak german by the way? I speak it and was wondering if you have a german channel too, just curious
@TechWorldwithNana
@TechWorldwithNana 3 жыл бұрын
Thank you Luke, always happy to hear such great feedback! :) Yes, I speak German but don't have a german channel. Can't imagine how much work it would be to create videos for 2 channels and handling everything besides that 🤯
@colinschi
@colinschi 2 жыл бұрын
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! :)
@mostafanizam2040
@mostafanizam2040 Жыл бұрын
Awesome... Can you please create one video for Jenkins pipeline code for best practices.
@blissweb
@blissweb 3 жыл бұрын
Excellent info for a newbie like myself. 🙂
@zavierrodriguez9236
@zavierrodriguez9236 3 жыл бұрын
Great video!!! Thank you!
Ultimate Docker Compose Tutorial
1:03:14
TechWorld with Nana
Рет қаралды 227 М.
3 ways to reduce the size of your docker images
17:20
Raghav Dua
Рет қаралды 24 М.
번쩍번쩍 거리는 입
0:32
승비니 Seungbini
Рет қаралды 182 МЛН
БОЙКАЛАР| bayGUYS | 27 шығарылым
28:49
bayGUYS
Рет қаралды 1,1 МЛН
Every team from the Bracket Buster! Who ya got? 😏
0:53
FailArmy Shorts
Рет қаралды 13 МЛН
Docker Crash Course for Absolute Beginners [NEW]
1:07:39
TechWorld with Nana
Рет қаралды 2 МЛН
Docker Image BEST Practices - From 1.2GB to 10MB
7:15
Better Stack
Рет қаралды 157 М.
8 Terraform Best Practices that will improve your TF workflow immediately
8:57
NGINX Explained - What is Nginx
14:32
TechWorld with Nana
Рет қаралды 314 М.
Using Docker Multi-Stage Builds
13:41
DevOps Toolkit
Рет қаралды 33 М.
The intro to Docker I wish I had when I started
18:27
typecraft
Рет қаралды 391 М.
Tmux has forever changed the way I write code.
13:30
Dreams of Code
Рет қаралды 1,1 МЛН
Docker с 0 до 100%. Всё, что нужно знать.
5:08:24
Building Docker Images - Best Practices
12:09
Marco Codes
Рет қаралды 8 М.
Proxy vs Reverse Proxy vs Load Balancer | Simply Explained
13:19
TechWorld with Nana
Рет қаралды 280 М.