‫Are you a fan of Linux desktops?
‫This is the Docker ‫installation video for you.
‫Docker Desktop for Linux is ‫actually a new thing in 2022.
‫People have been asking about it for ‫years, and Docker finally delivered.
‫So now we have Docker Desktop, what ‫I consider the best way to run Docker
‫locally for Mac, Windows, and now Linux.
‫In this video, we're going to ‫get you Docker Desktop, the
‫easiest way possible on Linux.
‫Then we're going to tweak some of the ‫settings you might need to change.
‫And then of course, get the course ‫repository from GitHub and get VS Code,
‫my preferred editor for any DevOps
‫And for Linux desktops, I am saying ‫Docker Desktop is the best way
‫to experience and learn Docker ‫Desktop on your local machine.
‫Now, for years, we have had the ‫standard Docker Engine for Linux.
‫In fact, that's how Docker got ‫started all those years ago in 2013.
‫It was just running on a Linux VM, ‫or server that you had somewhere.
‫And we didn't really have ‫a good setup locally.
‫It was only till years later that ‫Docker Desktop came around with all
‫of its extra features and the GUI, but ‫they're not necessarily the same thing.
‫Docker Desktop is a superset of ‫the Docker Engine and the CLI.
‫And on a Linux desktop, you could ‫choose to just run the Docker
‫engine, the Docker CLI, and the other ‫tools manually by installing them
‫with your package manager for Linux.
‫But Docker Desktop does ‫a little bit different.
‫It does it by creating a VM, a small ‫little tiny VM inside your Linux
‫desktop, just like Mac and Windows do.
‫One of the main reasons Docker chose ‫to do this instead of just installing
‫a GUI that manages the Docker Engine ‫installed on your host OS, which you
‫could do, but Docker Desktop on Linux ‫chooses to do it exactly the same way
‫as Mac and Windows for many reasons.
‫One of them is to give a consistent ‫user experience across all three
‫OSes for running local containers.
‫One of my favorite things about Docker ‫Desktop, besides all the features and the
‫GUI and it managing all my settings for ‫me, is that I can wipe it, really quick.
‫I can actually go in and click Reset ‫and it'll delete all of the things I've
‫changed and sort of reset it back quickly.
‫With a host Docker Engine, that's ‫one of the things you don't get.
‫Now you could use both.
‫In fact, the Docker Desktop that I'm going ‫to recommend you install here, I recommend
‫you really just stick with that for now.
‫But if you're someone who already ‫knows a little bit about Docker
‫and you prefer to just keep it ‫simple, command line only, you could
‫install the standard Docker Engine.
‫For that, the next video will focus on ‫Docker Engine for Linux server, because
‫that's really a command line only ‫solution, and that would be my normal
‫Linux preferred option for you, until now ‫that we have Docker Desktop for Linux.
‫So Docker Desktop for Linux is a superset ‫of that, and again, it provides all
‫those benefits of running in a VM, ‫and it's better isolated and you can
‫quickly delete it and recreate it.
‫It automatically updates ‫all the versions of things.
‫It runs over a VPN, all the things that ‫maybe the raw standard Docker Engine and
‫command line, which again, next video for ‫that one, they don't necessarily give you.
‫But you don't have to choose.
‫You can actually run both on your ‫Docker Desktop if you wanted.
‫It's going to be a little confusing ‫at first, since you're still
‫just learning Docker, but you can ‫actually use Docker command line,
‫something called Docker Context to ‫switch between one or the other.
‫So you can have your command line control, ‫either the one in the VM with Docker
‫Desktop, or the one running natively on ‫your host OS, talking to the host kernel.
‫It's up to you.
‫I'm going to focus on this video on ‫just Docker Desktop alone, without even
‫bothering with the host Docker Engine.
‫I'm going to leave that to the next ‫video, which is more about servers.
‫Now if you are a Linux desktop ‫user, which probably means you're
‫pretty good at Linux, like it's ‫probably not your first day on Linux.
‫You're going to need to pay ‫attention to the details and the
‫requirements of the setup here.
‫It's way more steps and it's way more ‫detailed than doing it on Mac or Windows.
‫It's just the simple ‫nature of Linux desktops.
‫It's usually more involved, you probably ‫have to install some extra requirements,
‫you may have to check your host OS and ‫not every Linux distribution will work.
‫Docker is making it work more ‫and more on various Linux desktop
‫distributions, but yours may not work.
‫In this video, I'm focused entirely ‫on Ubuntu, specifically 22.04, the
‫latest long-term release of Ubuntu.
‫When you go to the link for this, which ‫is in the resources of this video, you
‫can find the link to this documentation ‫that will probably change over time.
‫So maybe yours might work in the future.
‫At the time of recording this video for ‫example, Mint, one of my favorite desktop
‫installations of Linux with its cinnamon ‫GUI, does not work with Docker Desktop.
‫Docker Desktop focuses Gnome ‫desktop features and it does
‫have some Gnome requirements.
‫Basically, go read this document ‫because it's going to keep changing
‫as they get better and better support ‫across the spectrum of Linux desktops.
‫And you can see here that I had to ‫install some dependencies first.
‫Really getting just cURL installed ‫was one of the most important
‫things, because I'll need that ‫during the future install of Docker.
‫And then down here, I have ‫more of the steps I had to run.
‫Again, I'm just copying, pasting from ‫the tutorial on Docker's documentation.
‫And because this is Ubuntu, I'm ‫using apt and specifically, apt-get
‫to install a lot of this software.
‫And you can see once I get ‫to the actual Docker Desktop
‫install, look at all that stuff.
‫There's lots of packages there ‫required by Docker Desktop.
‫And that's why it's a little bit harder ‫to make it work in every different
‫Desktop distribution of Linux, because ‫there's so many libraries here, so
‫many dependencies, and this really is ‫just showing you how much more Desktop
‫can do than just Docker Engine alone.
‫And hopefully once that's successful, ‫you will see this if you search
‫for Docker in your start menu or ‫whatever Ubuntu's menu is called.
‫You can just search for it, ‫it'll be an app that you can run.
‫And as I've said in the other videos ‫for Mac and Windows, that Docker
‫Desktop, while not technically open ‫source software, though it does come
‫with some other open source software ‫like Docker Engine and Docker CLI,
‫which are themselves open source, ‫Docker Desktop itself is not, it
‫is actually licensed software.
‫It has some proprietary bits in it.
‫But the good news here is that it's ‫always free for learning, which I
‫have verified with management at ‫Docker, that they intend for it
‫to be free, regardless of who you ‫work for or what company you're on.
‫If you're allowed by your company or ‫whoever owns your computer to install
‫it, it is free for this course, it is ‫free while you're learning the tooling.
‫And once it started the first time, ‫you'll get the licensing agreement
‫page, then you'll see the "Get Started ‫with Docker" page, which you can step
‫through this, if you'd like the same ‫as Windows and Mac, or you can just
‫skip this part and jump into my course, ‫which is the reason you're here, right?
‫Now that Docker Desktop GUI there ‫will tell you whether or not Docker
‫is running successfully, but you could ‫also just go to the command terminal
‫and type in Docker version, like we did ‫the first few videos of this course,
‫and you'll get back the client-server ‫version, if everything is good.
‫And a little pro tip here for you, ‫make sure you log into Docker Desktop,
‫because then that will pass on your ‫authentication to Docker Hub, that's
‫where you're going to get all the ‫downloads for this course, all the images
‫that we're going to run inside Docker.
‫All those images for containers ‫will need to come from Docker
‫Hub or some other registry.
‫Most of the time it's Docker Hub, ‫especially when you're first beginning.
‫And that has pull limits.
‫We talked about this earlier in other ‫videos, but just make sure you log into
‫Docker Desktop with your free Docker ‫Hub account, and you don't have to worry
‫so much about any limits you might hit.
‫Of course, it's no big deal if you hit ‫them, you just wait a few minutes and try
‫again, but who wants to deal with that?
‫Right?
‫Let's just get to it.
‫Log in first, it doubles the limits that ‫you have on Docker's free Docker Hub.
‫And if you try to log in and you get ‫this "Credential store not initialized"
‫error, like I did, you're going ‫to go through a couple more steps.
‫Again, welcome to Linux, that ‫get the proper credential storage
‫solution on your machine to ‫securely store your Docker login.
‫And the documentation will probably ‫change over the next few months or years.
‫So I'm going to show ‫you what it was for me.
‫I simply needed to set up a GPG ‫key, but you may need a few more
‫steps, or it might be easier for ‫you on yours once Docker solves some
‫of these problems with automation.
‫And again, the link for these are in ‫the references for this lecture, but you
‫will jump over here to documentation and ‫basically run a GPG command to create a
‫key, and then you'll use the pass tool ‫to use that key and protect your login.
‫And you'll know that you're done and it's ‫working when you actually click the login
‫button somewhere in the Docker interface, ‫there's three or four places to click it.
‫And if you click that and then ‫you get this nice login screen,
‫that means it's working and you ‫can continue with your Docker ID.
‫Now that you've logged into Docker ‫and it's working, let's look at the
‫settings to do a couple of tweaks ‫that you might need for this course.
‫The easiest way to get to the ‫settings is under that Docker
‫Moby icon up there at the top.
‫Remember, his name is ‫Moby, he's the mascot.
‫Settings are over here, click it.
‫Because Docker Desktop runs in a ‫VM, you have resources to configure.
‫Now, Docker has conservative ‫defaults, which means you
‫probably want to bump them up.
‫Personally, I don't mind bumping ‫those up to a lot, because I don't
‫run Docker all day, every day.
‫When I'm using it, I'm running it ‫and it's using some resources, but
‫when I'm not using it, I just quit ‫or pause it, and it's not using
‫really any of these resources.
‫I usually give it more CPUs and more RAM, ‫somewhere between 6 or 8 gig if I can.
‫If you don't have that ‫much, don't worry about it.
‫Just give it enough to make ‫things happy when you run Docker.
‫And you'll know if things aren't ‫happy, because they'll be either
‫really slow or you'll get back ‫errors when it runs out of memory.
‫Now this little setting is an interesting ‫one, because it's similar to what we deal
‫with on Mac and even Windows, where we're ‫going to be sharing files later from our
‫host operating system into the containers.
‫Now, in this case, it's in a virtual ‫machine, which means you're sharing
‫files from your host, the source ‫code, into a container inside a VM.
‫So there's some special magic Docker has ‫to do to share across the file systems
‫of these two different operating systems.
‫The host into the container inside a VM.
‫So you want to make sure that ‫the directories where you store
‫your source code are over there.
‫And the default includes your home ‫directory, so I just recommend
‫always clone your code into your ‫home directory on your local machine.
‫It has the right permissions.
‫It's automatically set up to share ‫by default, and I just generally
‫recommend that for all of my code.
‫And I typically just put ‫it inside /home/bret/code.
‫I just put everything inside that ‫code directory that I download from
‫GitHub or any other source code.
‫Now, if you've heard about VS ‫Code, I think I mentioned it
‫in every video on this section.
‫It is my favorite code editor, but you ‫don't have to be a developer to use it.
‫In fact, I think it's now the best way to ‫edit Infrastructure-as-Code files, DevOps
‫files, sysadmin files, scripts, anything ‫you might do on the non-dev side of tech.
‫I still think Visual Studio ‫Code is the best way to do it.
‫And it runs on every OS.
‫It runs on Linux, so download that.
‫And then in a few videos, you'll ‫be seeing my recommendations
‫on your setup for VS Code.
‫But really, it's just about extensions, ‫my favorite extensions, which VS
‫Code will actually just recommend ‫to you when you open the files.
‫It'll say, Hey, you opened a ‫Terraform file, would you like to
‫install the Terraform extension?
‫Or hey, you have Docker installed.
‫Would you like to install ‫the Docker extension?
‫It does all that for you.
‫So really, you don't have to watch ‫my VS Code video, but I do try to
‫give you a few extra tips there.
‫And finally, you just want to clone ‫the repo from the course, the lecture
‫earlier, with all the links in it ‫in this section, for downloading all
‫the different Docker things you need ‫includes the repo that you want to get.
‫And you're just going to click that ‫link there, the little green button,
‫and that'll give you the URL that you ‫would use in a get clone command to
‫download this entire course repo, which ‫you'll be using throughout the course.
‫And that's it.
‫If you're a Linux, Desktop, Desktop ‫user, you should be fully set for
‫the remainder of this course, with ‫all the tools you need and have fun.