it's been asked many times Docker how do I use Docker now for an I.T professional it's almost an essential utility and honestly I would say it's almost an essential utility for anybody out there there's so many cool things you can do at Docker as I've addressed in the past couple weeks because you don't need a whole bunch of Hardware it is literally Consolidated down into little containers not virtual machines but containers so let's get into it this is going to be a pretty a good one for anyone that's not familiar with Doc or what it
does how it functions I'm just going to touch the basics here now let's show you how to make a container because honestly you're probably not going to need it Docker has been so widely adopted that pretty much anything you can think up has already been done and you can just look it up on the internet so let's get into it because ah I love Docker so much and couldn't imagine life without it to get started we need to install Docker right uh installation can be a bit cumbersome when it comes to using the existing images
and other things that Docker has in existing repos whether you're using Mac Windows Linux I caution you don't just do Docker or or apt install Docker or or if you're on Windows going into WSL and just saying install Docker these things are bad because it's going to be an old version of Docker you're going to have summon compatibilities with some containers it just it can turn into a nightmare so when you look at these I always recommend the official page like even on my little guide with all my quick commands and everything we're going to
go over today I say hey for the installation go to the official docker.com and get it from there because I want you to always have a good experience whether you watch this today or two years from now so when you look at this you'll notice here's the supported platforms for Linux here uh the big thing when you're clicking through to install is remove Docker Dash desktop if you have already installed it clear out any files that maybe that old version left behind because we want to make sure we have a really good base system and
then for the installation we're downloading the actual package if you're on Ubuntu or Debian it's going to be a Dev package if you're on Fedora it's going to be an RPM package and you just follow and copy these commands from what you've downloaded other things that we're going to tackle in this as well is Port tainer Port tainers really neat it's a great way of just getting a heads up GUI and saying okay what containers do I have all that right at a glance notice and we're going to go through some of the cool aspects
of containers and updating and other things that Docker does but I will be touching on the this but I want to start with the actual commands what Docker is images and containers first up what's an image just think of it as like a downloaded zip file that just sits in your downloads folder and you're waiting to install that the image is just uh the thing that the container needs to be made and then the container is your running environment now depending on what's going on that container just is a mirror of all the settings in
the image unless you change things and map them from your host system the container really doesn't change per se it can you can modify stuff in that container but on a refresh it's going to wipe out those settings if it's not saved elsewhere outside the container in reference so very important to understand these things and we're going to talk about that referencing but I want to go into actual commands with that basic knowledge understanding you have the essential command Docker run that every single guide on the internet has what does it do well Docker run
will download the image it'll go Docker pull image that's what's really running in that background and then it will Docker start or install that container using the Run command so it grabs the image and installs the container all in one command that's what Docker run does and there's always triggers in things that are added to that command and I want to walk through some of those first naming the container if you don't put a name it's just going to be some funky random name that it picks out so I do recommend naming your containers but
it's not necessary if if you're mainly using a GUI like me a lot of times I just admit it the next thing is any ports power what's this doing is it just mapping to an existing Port does it want to use and do a bridge with the existing Network on that system know that you can actually translate ports let's say you have five different Apache services or or you're launching web servers and they all use port 80. that's problematic they're going to be conflicts if they're all trying to use the same port right well cool
thing about Docker and some of the power here is it can translate these ports so you could take uh the container Port of Port 80 that's the destination and you can put for the host Port 81 and then you can put 82 83 84 and make a ton of Docker containers all of them using the container Port of 80 but a different port on the host system so when you launch into that Docker container it may be using Port 80 in the container but it'll use a completely separate port on the actual host system which
is great and if you don't want to mess with any of that you could just map all the ports and just say hey I want a complete bridge if it's using Port 80 over here on the host system it uses Port 80 and you just map all the ports to to basically Bridge everything so you don't have to worry about network issues and then finally you can do like a Daemon so or a background service and and this just runs that image every time your system starts up and that's it this is also a very
essential Command 2 with Docker is the dash V what this does is occasionally you're going to run into an out of date system like like my port tainer here I've added settings and other things into here if I do an update to this image and relaunch this container using this image it's going to wipe out anything that's not mapped to my host system so this is one command that is really essential with every Docker container you use the dash V you you map that directory to your target directory in the container and that basically just
says Hey when that image gets recreated you're using that same Docker run command and it's just saying hey yeah this is all this image is completely new but that's okay all the settings for the dash config folder is going to be over here in my host and that never changed even though we wiped out that whole container and relaunched it that mapping of the local directory to a Docker container if it's hosting any settings you're going to always want that mapping to occur otherwise you'll change stuff and then relaunch that container and all of a
sudden all your settings are gone you're like oh no what happened well you forgot to map the directory so really important and then managing it like a Docker PS command uh usually whenever I'm running things I'm in I want to teach you these command lines not just installing portaner or some management because it's really important for troubleshooting so these basic commands just kind of get you by and then I use port tainer really for a lot of the management just quality of life I find it a little easier but having said that there are times
where I'm like okay what are my running commands Docker PS or I could just do a dash a say hey what show me all the docker containers even the offline ones that aren't necessarily spun up and that's what that does you can remove them with RM command you can stop and start the container so let's say I wanted to stop the container portaner so we'll just go Docker stop and then the container name let's break down this PS Command 2 just so you understand what you're looking at you have the container ID you have the
image this is the actual image I'm using of Port tainer you have the command that that image is running in there you can see it was created 13 days ago it's up time is two hours and then you see all the ports it's mapped now obviously this is pretty much a bridge Network it's using all the ports that Port tainer needs but I can map these to on the host system to something different like I've explained and then finally the name right here is the container so we'd want the name of the container that last
line is probably the most important thing so when we go to Port tainer stop we stop that Port tainer directory so that web page if I reloaded it it was just so not found it's not running so if we do Docker PS see nothing's running and we do a dash a and you'll notice oh well it's right there so we want to start that up again we'll just do a Docker start and then Port Tanner's back up and this all happens so darn fast that you let's say we do a Reload you'll notice it it's
already back up Dockers are so much faster than using the VM or anything it's just magical so obviously I've set all this up uh Port tainer let's just delete this let's let's start over because I want you to have this nice GUI because it's so nice just to pop in here and go okay what images have I downloaded what networks have I launched what volumes and other stuff has Docker have and this is all just a nice running image to where I'm always in here and I'm like okay what containers I usually am on this
page I bookmark it usually and see what all I'm running as far as an image goes so let's install our first one after removing uh the existing portaner so to remove again we'll just do Docker PS okay well this is running we don't want that Docker stop port tainer stops it we can do a Docker RM port tainer boom portaner's gone it's in the wind so how do we download that image and install it well we just do a Docker run but where do we get that Port tainer image well this comes to the second
link in my guide if we look uh we go to the official Port tainer website again I want to show you the official documentation in case this ever changes in the future you just come here I'm installing it on Linux what do I need to do okay I need to create a portaner volume now a lot of times you don't create a volume just in pertainers thing it's already here now I've already created this volume obviously that's what I was using and then we just run this we'll just use the Community Edition and hit copy
come back into our prompt and we'll just paste that in let's break down this command and everything it's doing really fast so we have Docker run it's mapping these ports you got eight thousand nine four four three so we know it's going to use those two ports it's naming it Port tainer it's restart always so if something happens in the crashes it's going to restart it and then it's mapping the portaner data volume to this in the actual container so the dash vs are really important if you don't use Dash fees on in reinstalling or
updating your containers to the latest versions everything will be wiped out I just have to reiterate that because newbies onto Docker will always forget this and then they'll make changes and then they update and then disaster strikes so we'll hit enter and this will go ahead and pull and install our portaner again and we'll relaunch it so it should be already done let's do a PS all right it's up we got the latest version you can see the latest tag here and let's relaunch our port tainer and for Port tainer I think it's actually localhost
443 and there we go now you'll notice I have to set a whole account name and password uh as it didn't retrieve the environment variables so I probably could have done a little bit more on my mapping but I didn't so oh well and it's saying hey my password length was pretty small we recommend a stronger one I'm like ah whatever so from here we see the environmental local now on initial setup you may get prompted hey do you want to create an environment or you just want to use local you always just click local
setup and you never have any issues uh if you're obviously you can put Port tainer outside of the host system that's when you might use those other options but a lot of times I just throw portaner on whatever Docker system I am uh there's other things like kubernetes that maybe maybe you might see in the comments kubernetes is great when you're building like a scaled environment in big business but for everyone like a home lab user and stuff uh don't don't worry about kubernetes it's just going to be too much trouble for you where Dockers
are just so simple and everything's kind of already there it it's awesome for just your one-off systems uh when you get into like Docker swarm and stuff that's when you typically would move to kubernetes and just say okay it's time to get with the big boys but for most people if you're watching a YouTube video about docker this this is just fine just use your local so we're gonna go in here let's take a look at our images what do we have oh look at that that's the old version of Port Tanner in our images
we could actually delete this why I love Port tainer so much is it just gives everything a nice heads up so I can flush old images so it doesn't take unnecessary 300 megabytes from my system I can look at my existing containers what's running what ports it's using it's allocation all those things are so nice and you can look at the stats of each one how much memory are they using ah it's just so well done that's why I love Port tainer I always recommend everyone set it up because this is the really the way
to do it and then I usually use my guides here to install so let's uh see what are what else can we use Docker for that's the other thing so now I got your mind going you got like a really good base understanding level you got your cheat sheet over here to manage install uh all these images that's great if we have problems you could look at the logs here so let's say portaner doesn't run you could do a Docker log and then type Port tainer because that's the container name of it you can look
at Docker stats but let's install another one uh what do people use Docker for and that is you know a whole bunch of stuff so you could do WordPress you could do web stuff that's typically the the primary use for newbies to Docker and then you get into more things like emulating entire systems like Ubuntu and Centos and Fedora and all the Linux distribs are great to run into here uh probably the biggest one that I still need to make a video about is Alpine Linux and it's really really really small footprint they're great for
Docker containers you're going to run into a lot of Alpine in the docker Community but you can install anything here look at this you get sonar you should uh if you never want to pay for a streaming service again you got to check out sonar that's not this sonar two hours but I digress and I can't mention any more than that people aren't supposed to know about sonar best kept secret for most people in it and then uh yeah we got other stuff uh the big thing uh that a lot of things like Chrome OS
he really utilizes lxce these are Linux containers that are pretty much pre-built ready to go a lot of times so lxd is a really fun one to Tinker with but one I kind of wanted to touch on today is Dashi this is a Docker one uh I know techno Tim did a video on Dashie or I think it would I think it was him and let's just copy this in here and take a peek now 8080 I don't think we have any in conflicts let's just make sure yeah eight thousand nine four four three is
what this one's using let's launch into and install Dashie now dash is great for home lab users where you can have your own custom dashboard that's really what it's for and it's running into an error probably because uh it's trying to map my home folder my Dash conf yaml file to the app public yaml file that actually doesn't exist even though this failed I think it still shows it's created it just doesn't have that yaml file yet so let's create that so that's a good example of something that it installed and created the container and
downloaded the image but because of these settings when we just did a copy paste without reading uh we missed something and that's where these error messages can get a little convoluted but if you really focus down and read you can kind of see what the error is error mounting home Titus my conf ammo file right there is really our big problem so let's create that real fast so I'm going to just go down to the config section right here this looks like the yaml file that we need Lucy 93 and I'm just going to change
all this to my user Chris Titus Tech and I'm going to change that Dashie my windows utility is probably the one I'm in the most let's change that that'll show me GitHub and some issues we can configure all these items in Dashie and how they they utilize that that's pretty good idea uh let's go to firewall I put my firewall IP here uh game server or something I wanted to check to see if it was up should be fine so now that we have a yaml file I bet if we come back into port tainer
and we go to our dashboard let's try and start this up again and see if it actually runs this time and the cool thing from our Port tainer section let's look at our logs okay this one this time around it doesn't look like we got any errors and it didn't stop the container immediately a beauty of using poor Tanner is all you have all the logs right here but if you don't and you're using it from a CLI by all means all that's right here in the cheat sheet as well coming back into our containers
section it's starting up still and it should be 8080 is the port that's getting mapped to 80. all right coming back into localhost 8080 you can see we have those things in there if we click on it should launch into my GitHub okay that's cool what issues I have going on with that uh we've got about 108 open right now need to get on that and then if we had certain images or whatever we wanted to pull into here we could have a nice heads up display again check out techno Tim's channel for that great
guy for home lab stuff but I wanted to just kind of touch on some of the importance of Docker what other uses of Docker do you have because I have probably upwards of 15 Docker containers running in my current home environment in business environments this can get quite a bit uh bigger it just depends on what's going on but it saves so much in resources power utilities all of that love Docker learn it love it live it with that let me know your thoughts down in the comments and I'll see you in the next one