you need to learn Docker RIGHT NOW!! // Docker Containers 101

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

And still don't get it.

All those fancy docker images are prebuilt and hosted on the hub, but every change you made is lost on exit.

You must commit the changes or create a DOCKERFILE knowing beforehand what you will need.

That, in my case, is what all these tech gurus fail to explain.

👍︎︎ 1 👤︎︎ u/srgp 📅︎︎ Apr 15 2020 🗫︎ replies
Captions
hey do you want to see me build a docker container yeah let's do it real quick [Music] done want to see it again done man that was fast [Music] docker containers if your NIT you got to know it if you want to learn cloud as your AWS Google Linode DevOps networking systems I think I said everything right so I hope you have your coffee ready in this video we're covering three things first what the junk is docker - you're getting hands-on with docker I'm giving you access to a free lab thanks to the sponsor of this video Len owed and then three will go a bit deeper talk about the big why why docker alright let's do it okay what the junk is a docker container whoa we're getting ahead of ourselves here before we can define what a docker container is we have to first define what it's replacing virtual machines what is a virtual machine how many of you already know check the timestamps to jump forward but we're gonna cover what it is real quick and I actually have a ton of virtual machines running on servers in my data center right now and I've been meaning to get those servers out of there except I'm paying a high bill I want to bring those home with me all right now let's go get it [Music] things should I goodbye netizen [Music] [Applause] here's one of my babies oh my servers now before we answer the question what in the world is a docker container we have to first talk about what's a virtual machine let's dig in so this is my server traditionally before virtual machines you would install one operating system on this piece of hardware whoo dusty all of the server's resources from the CPU to the RAM to the hard drive all of it was dedicated to one operating system one server OS so like I might just have Linux and this is my Linux server or I might just have Windows this would be my Windows Server 2016 now what's the issue with that well none really unless you want another server another operating system so before virtual machines if you wanted a Windows server and a Linux server you had to have two physical servers like this so that's where virtualization comes in instead of installing one operating system we're gonna install something called a hypervisor now a hypervisor is kind of like an operating system but it only has one goal its goal is to help you carve up or divide your servers resources into multiple servers now there are a ton of hypervisors but the most popular one would be VMware which is what I have installed on my servers and specifically it's called ESX I bonus points if you tell me in the comments what this means or what it stands for and simply what it allows us to do is take a portion of our servers resources maybe 2 gigs of RAM 2 CPUs 100 gigabytes of hard drive space and this will be our boon to serve and then on the same server I could say over here I could have one CPU not cup one CPU two gigs of ram 40 gigs of hard drive space and that will be my Windows Server 2016 and I can keep doing this until my server runs out of resources or I can even make these bigger going from I don't know one CPU to 41 I mean you can go crazy virtual machines are amazing and people use them every single day but that's not how docker works in fact doctors kind of well not just kind of it's different when we use docker containers it takes us back to before virtualization we're gonna install one operating system on this entire thing so one operating system gets access to everything our server has to offer but why do that that's the big question right what does docker doing here's what it is and this is crazy I want to drop this line on you okay where virtualization and virtual machines are virtualizing hardware docker virtualizes the operating system what what does it even mean now that's right here is what we commonly see when we visualize how virtualization works we have our hardware we've got our our hypervisor and then we have our guest operating systems but let me show you what docker looks like we'll always have our hardware but instead of a hypervisor like we just discussed we're gonna have one operating system installed on top of this hardware or on to the hardware and let's just say for our case we are going to install Ubuntu now here we go well then have our good old buddy dock our fly in and make some magic happen docker installs like any other application you might install on Linux it'll be a process running or a daemon running and then using docker we will virtualize portions of our operating system in this case ubuntu to create containers which by the way we'll define here in a moment but they're really doing the same thing as these virtual machines over here they have the same function and they have a lot of the same qualities which is why it's kind of cool how they can replace virtual machines controversial but that's what I think and these containers much like the ends can be running a different operating system sent OS and even Ubu too you can install Ubuntu on Ubuntu what okay but what are these things what are containers I like to think of them as crazy fast lightweight microcomputers and don't let micro fool you like they're they can be as powerful as you want them to be and similar to a virtual machine they'll have their own operating system their own on the CPU processes their own memory their own network and the most important thing I think it's really appropriate for nowadays is that they're quarantined they are isolated they are secure as far as they understand they are their own thing they might as well be installed on bare metal servers because that's how isolated they are well said there's isolated as you are right now what too soon let me say it again these suckers are light weight and they are wicked fast like you saw at the beginning in this video click BAM it's there now we'll cover why they're more lightweight why they're faster and and more of why they're amazing here in a moment but I think it's time I think it's time to get your hands dirty your feet wet all those things we're gonna do that right now time to get your hands on with docker containers I'm so excited about this you might say I can't contain myself okay here we go fire up your web browser go to the link below Linode comm forward slash network chuck and you get $20 a free credit more than enough to play with docker so go ahead and create that free account and we will start lobbing right now now as I mentioned before blue node is a cloud service provider very similar to AWS Azure Google and we're going to use them as our cloud service provider right now so from the dashboard we'll go to the top right and click on create and we'll create a Lilla node now right now you should be on distributions I want you to click on one click click on that and this is what's really cool about this look at all these pre-built apps you can just deploy in the cloud WordPress Open VPN run your own VPN server in the cloud minecraft ok cool csgo I kind of want to do this now anyways the one we want to look at now is obviously docker BAM a select docker now you can install and run docker anywhere Windows Linux you can install on a virtual machine but this is great because it makes it easy docker is already ready to go I'll just click create I'll select my size 10 bucks a month hey that's half of what you are getting for free right now I'll name it my friggin sweet doctor lab and then a root password for your root user and then click create yeah forget my region I'm in Dallas that way gets super fast performance go now this is essentially creating a virtual machine for you in a leno cloud and it's pre baked with docker and once yours is ready click on launch console at the very top here and here in the browser you have access as soon as it's done doing your its updates but if you're like me I'd like to use your own terminal more of a homey feel so I'll grab the public IP address right here copy that and open up my own which is solar putty I highly recommend solar putty you should use it go download it now link below it's free and I'll connect your name root and the password is what I just set and I'm in I'll clear this out I've got my own ready to run docker Empire yeah call it that so for this lab we're gonna do three things we're gonna install sinto s we're gonna install alpine and a third mystery thing which makes docker the coolest thing ever so hang tight let's do let's do Sint OS first first I need the image so I'll do docker pool sent OS what this is doing is it's going out to the docker hub which is a registry of docker images these images are what we use to run or create our containers I'll show you real quick so I'll go ahead and pull the image force into s it'll go out and find it and download it BAM we've got it so now with that sent oh s image we're going to run our first docker container so it'll be the command docker run we're gonna use a few switches - D and - t will do - - name - name this container I'll name mine can't contain myself name yours whatever you want and at the end I'll specify the image I want to use which is the one we just pull down sent OS and this is how fast docker containers are created and run it's running but that was it a virtual machine booting a virtual machine takes a whole lot longer than that but that's crazy so let's make sure it's running we'll use a command docker PS to see our running docker containers there she is and she's so pretty look at her that is sent OS isolated secure running with its own operating system CPU memory network oh it's quarantined but let's um let's walk into the room real quick we can connect us in to us and start playing around with it by using the command docker exec I'll use the switch - IT and then I'll reference the name we named it so it was can't Payne myself for me if I spell it right and then after the name I'll specify I want to connect to the bash shell boom and I'm in Sint OS I am in a container and look I mean it even has its own file system like it's completely separate to get out of there we'll just do a quick type in exit and we're back at home and you'll know where you are if you just pay attention to root at blah blah blah that's the container ID we were just in Sint OS over here is my docker machine here so I'm gonna clear my screen let's do another one will do docker pull let's say we pull down Alpine a very popular Linux distribution because it's very very lightweight especially for docker C I mean it pulled it down so quickly and it'll do docker run - t - d I'll name this oh yeah and then the image name was Alpine boom another one started by do docker PS - containers running awesome let's connect to it dr. exec - IT oh yeah and then Alpine I'll just connect to the shell so I'll type in SH and boom I'm there I'm an Alpine a separate operating system a separate container quarantine it's so cool you know what you can do this too if you want I'm gonna install a whole bunch of things right now ok so now if I do docker PS I got a few things going on I've got three different flavors of Ubuntu running right now 16 14 and 18 all in the same server that's amazing WordPress it's it's it's cool now for number three and I want you to do this with me this is actually a a docker image that I created a while back for my as your course on CBT Nuggets say to uncheck that course out link below but using this image I want to demonstrate the power the amazingness is that a word yes it is now of docker let's do it real quick so first I want you to pull down my image not to find it let's go to docker hub its hub docker calm this is a registry where you can download and pull all these images from docker and they have a ton of stuff them some of the stuff they have is from me so if you type in network chuck in the search bar I come up here and actually have two out there I don't know the other ones for but the one I want you to click on is coffee based training has 879 downloads that's pretty cool jump in there and even shows you like the command you can use to pull down this image now don't use that just yet I want you to copy the network Chuck /nc coffee and we're gonna use the tag French press and I'll show you how to use a tag right now so the command will be docker pull I'll paste in my name here the network Chucky Chucky the network chuck /nc coffee and then colon French press the tag basically gives us the ability to download different versions of a particular image I did that with Ubuntu just earlier I could specify the tag 16:17 whatever and download different versions so I'm gonna pull down my image boom it's ready now I'm going to run it clear things out here so I'll do docker run - T - D and then one more switch here - P which sense reports and we're going to map port 80 which is a port for a website obviously we'll map that from our docker container to our host and for any exam people out there here we're studying for the dead net associate or CCNA the port right here at the end is for the docker container and the port right here is for the host so I'm essentially saying match port 80 - port 80 and then I'll name my guy name it in sea coffee and then I'll specify the image which is the network chuck port slash NC coffee and then colon French press and it'll be quick done I'll do docker PS it's running now here's what I want you to do if you go back to your Linode dashboard here grab the IP address once more copy it and then just plug that into your browser go to it it's a docker container running my website I mean obviously it's a professionally designed website click on the link it'll take you CBT Nuggets I mean it's it's top-notch if you want to hire me for web development I'm available let me ask you a question did you set up this website did you alter any settings install any programs did you put in this like did you do any of this no but if you pull down that image and ran that container like I just demonstrated you have a website that looks just like this you see that container not only has its own OS CPU processes memory but it also has all the settings I applied our website configuration all the prerequisites all the dependencies packaged together in a neat little package a container no need to mess with it it's perfect and you can move that sucker to any computer any Linux based machine and it runs like a champ I can move this same docker container to AWS to Azure to your computer to my computer to wherever and it's gonna run the same and that's the power of docker so everything from the OS which is Debian Linux to the things I had to install and make it work engine X which is a web server software and then all the website files that I used which you can tell by the quality of the site took a lot of stuff and then anything else I might need all dependencies packaged into a nice neat container that can run anywhere and now we're at number three of our objective kind of talking about the big why what why why docker containers why are they so killer compared to virtual machines and really why should you care about them we've seen a few of the things like they're lightweight and they're fast and we just saw what I think is one of the coolest things about it is that they're portable no matter where they run they run another example of why this is absolutely killer is like look here I've got different flavors of Ubuntu I might have apps that aren't compatible to run on a certain version of Ubuntu oh and by the way before we go any further if you want to stop any of these containers you can do that here just do stuff docker stop and then the container name so I'll drop like one of my I'll drop Alpine oh yeah and then I can start them right back up again docker starts oh yeah and bam he's up again and if you want to like see how much CPU they're using a memory Network we can do doctor stats and we get this cool I mean I think it's cool view of all that's going on real-time and then control see to back out of there well this is for all of you who told me to try out Arch Linux I can install as a docker container as well and boom just like that's I'm running Arch Linux okay at this point we've learned a bit about docker containers we've even created a few and played around with the command line that that was fun now we're gonna go just a little bit deeper not too deep because we we don't have the time but we'll talk about okay why is it so fast why is this so lightweight and how is the industry using it right now this will be real quick let's talk about it so first of all why is it so fast how does it boot up so fast how do we create containers so quickly what's voodoo behind that the short answer is that you only need one kernel notice that over here when I'm demonstrating docker all of these OS is our Linux based they all share the underlying Linux kernel just like Ubuntu does so a boon to when we installed him he's running off the Linux kernel and it's the same Linux kernel that all of these OS is right here would use so this part of the OS is already up and running and that's in stark contrast to over here on a virtual machine you see each of these OS is have their own Linux kernel there spinning up I'll put LK for the rest because they are virtual machines and every time you deploy a new virtual machine that's another Linux kernel and in the operating system and that steps into the other part is they're lightweight why are they lightweight because we don't need more than one Linux kernel you see these rotor machines to run more than one OS and have this app isolation like we want to with containers we have to have a guest operating system every time which involves another kernel it involves a hypervisor which is also kind of heavy so it's overall just heavy there are more parts and pieces that have to be running to make that work whereas a container it's much more simple lightweight and fast now one thing I want you to note and you probably noticed this I have a Windows server over here but I didn't install Windows Server over here on Linux you can't do that containers are available docker you can install on windows-based systems Windows 10 Windows Server I believe 2016 and up but you can only install windows-based containers on a Windows system same goes for Linux you can always Emily install Linux based containers on a Linux system because they share the same underlying OS or kernel and yeah docker on Windows is cool you can install docker containers on Windows and it shares the same qualities as a Linux docker container they're isolated they have their own processes in memory and network it's it's just as cool now what I've given here was a very high-level overview we didn't go very deep at all Dockers a big thing like there's there's an entire docker certification it's is huge and if you want to learn more go deeper because there's a lot more maybe you want to learn more about how containers work maybe you want to learn hey they're using control groups which are defining how much CPU how much memory how how much OS resources that you're giving each docker container and then how they're segmenting and isolated isolating everything with namespaces and by the way these two concepts that can be attributed to containers have been around for a long time containers have been a thing for a very very long time docker isn't the only type of one either so it's a whole big thing so if you want to dive deeper he's gonna create your own docker containers it's a great course from Sean powers at CBT Nuggets link below and if you want to learn more just about the behind the scenes and under the hood I'll link some books and stuff below as well now the last thing I wanted to mention is how is the industry using docker well we already demonstrated that we could put a docker container up in the clout Linode we just did that you can move that same docker container to Azure to AWS they have the same sort of situation with docker it's just a web app you deploy and you can launch your containers this is killer for developers because they can write their code deploy it in a docker container and know that it works everywhere and that's a problem with developers that they've had for a long time is that they'll write an app on their computer and it works great they spent time polishing it you know dot in their eyes and all kinds of stuff and then that same code is run by I don't know a tester and it doesn't work and the developers like well hey it worked on my machine I don't know what you're doing no more of that junk no more of that because if you deploy it in a docker container everything that app needs is right there in its container it's containing it's isolated and finally the last thing that is kind of taken the industry by storm is the concept of micro services this is more free developers but as a person who's an IT and as you move into more DevOps stuff this is stuff you'll understand and have to work with micro services involves taking portions of your application your stack and and segmenting it into smaller bits and pieces so traditionally you might have you know one server where you install your entire application everything you need so for example WordPress you might install your WordPress server and your your my sealed sequel database on the same box and that's traditionally what developers might have done is they would install as many compatible apps as it could on one server but now with containers they can take one app in particular like maybe just the WordPress server and have that in one container and then maybe take the my sequel pour didn't have that on one container so they're isolated there's no conflicting things and when you want to update one portion of your app you're just updating one container and that's a whole other topic for a discussion a whole big world it's fun it's exciting and I'm hoping that this video got you started on docker and it won't be your endpoint I hope you go further with this and you know let me know if you want me to make more videos about docker cool well that's about it and talkers a big thing and I hope you be a thumb watching this video let me know what you thought in the comments and also let me know how you're gonna use docker I mean there's a variety of ways like for example in my own home I have docker running a my Synology server and I have a container that's running home assistant which is a home automation framework I guess it's really cool you can also run things like piehole and just a ton of stuff it's it's it's amazing what you can do not to mention that if you're learning Linux you want to try out all kinds of different Linux distributions you saw how easy it was to set up that lab oh my goodness it's so powerful whoo I've been talking too much so if you haven't already hit that subscribe button if you like what I'm doing here and hit that notification build always get notifications when I go live or when I have new videos and also don't forget to support the sponsor of this video Linode if you want to deploy a website or an app or just a minecraft server link below you get $20 credit so if you didn't get a chance to lab do it now I'll catch you guys later [Music]
Info
Channel: NetworkChuck
Views: 1,169,387
Rating: 4.9465394 out of 5
Keywords: cbt nuggets, ccna, ccna study, ccna training, cisco ccna, cisco training, comptia a+ 901, comptia linux+, comptia linux+ exam, comptia linux+ xk0-004, information technology, linux tutorial, linux+ exam, lpic 1, raspberry pi, raspberry pi projects, top 10, what is docker, docker tutorial, docker (software), docker container tutorial, docker container, docker images, what is docker container, learn docker, docker container basics, docker hub, docker tutorial linux
Id: eGz9DS-aIeY
Channel Id: undefined
Length: 23min 19sec (1399 seconds)
Published: Thu Apr 02 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.