1 00:00:00,604 --> 00:00:03,364 ‫Are you a fan of Linux desktops? 2 00:00:03,664 --> 00:00:05,704 ‫This is the Docker ‫installation video for you. 3 00:00:06,423 --> 00:00:11,013 ‫Docker Desktop for Linux is ‫actually a new thing in 2022. 4 00:00:11,343 --> 00:00:15,333 ‫People have been asking about it for ‫years, and Docker finally delivered. 5 00:00:15,333 --> 00:00:20,193 ‫So now we have Docker Desktop, what ‫I consider the best way to run Docker 6 00:00:20,193 --> 00:00:24,003 ‫locally for Mac, Windows, and now Linux. 7 00:00:24,570 --> 00:00:27,840 ‫In this video, we're going to ‫get you Docker Desktop, the 8 00:00:27,840 --> 00:00:29,550 ‫easiest way possible on Linux. 9 00:00:29,790 --> 00:00:32,610 ‫Then we're going to tweak some of the ‫settings you might need to change. 10 00:00:32,880 --> 00:00:37,950 ‫And then of course, get the course ‫repository from GitHub and get VS Code, 11 00:00:38,040 --> 00:00:41,190 ‫my preferred editor for any DevOps 12 00:00:41,408 --> 00:00:46,658 ‫And for Linux desktops, I am saying ‫Docker Desktop is the best way 13 00:00:46,658 --> 00:00:50,078 ‫to experience and learn Docker ‫Desktop on your local machine. 14 00:00:50,721 --> 00:00:55,521 ‫Now, for years, we have had the ‫standard Docker Engine for Linux. 15 00:00:55,521 --> 00:00:59,221 ‫In fact, that's how Docker got ‫started all those years ago in 2013. 16 00:00:59,691 --> 00:01:04,791 ‫It was just running on a Linux VM, ‫or server that you had somewhere. 17 00:01:04,911 --> 00:01:06,831 ‫And we didn't really have ‫a good setup locally. 18 00:01:06,831 --> 00:01:10,011 ‫It was only till years later that ‫Docker Desktop came around with all 19 00:01:10,011 --> 00:01:14,611 ‫of its extra features and the GUI, but ‫they're not necessarily the same thing. 20 00:01:14,671 --> 00:01:18,951 ‫Docker Desktop is a superset of ‫the Docker Engine and the CLI. 21 00:01:19,546 --> 00:01:24,396 ‫And on a Linux desktop, you could ‫choose to just run the Docker 22 00:01:24,396 --> 00:01:28,636 ‫engine, the Docker CLI, and the other ‫tools manually by installing them 23 00:01:28,686 --> 00:01:30,516 ‫with your package manager for Linux. 24 00:01:30,936 --> 00:01:34,026 ‫But Docker Desktop does ‫a little bit different. 25 00:01:34,056 --> 00:01:39,456 ‫It does it by creating a VM, a small ‫little tiny VM inside your Linux 26 00:01:39,456 --> 00:01:41,976 ‫desktop, just like Mac and Windows do. 27 00:01:42,276 --> 00:01:46,581 ‫One of the main reasons Docker chose ‫to do this instead of just installing 28 00:01:46,596 --> 00:01:51,156 ‫a GUI that manages the Docker Engine ‫installed on your host OS, which you 29 00:01:51,156 --> 00:01:56,856 ‫could do, but Docker Desktop on Linux ‫chooses to do it exactly the same way 30 00:01:56,856 --> 00:01:59,136 ‫as Mac and Windows for many reasons. 31 00:01:59,136 --> 00:02:03,156 ‫One of them is to give a consistent ‫user experience across all three 32 00:02:03,156 --> 00:02:05,796 ‫OSes for running local containers. 33 00:02:06,096 --> 00:02:09,996 ‫One of my favorite things about Docker ‫Desktop, besides all the features and the 34 00:02:10,186 --> 00:02:15,296 ‫GUI and it managing all my settings for ‫me, is that I can wipe it, really quick. 35 00:02:15,366 --> 00:02:20,706 ‫I can actually go in and click Reset ‫and it'll delete all of the things I've 36 00:02:20,706 --> 00:02:22,926 ‫changed and sort of reset it back quickly. 37 00:02:23,256 --> 00:02:27,006 ‫With a host Docker Engine, that's ‫one of the things you don't get. 38 00:02:27,577 --> 00:02:29,107 ‫Now you could use both. 39 00:02:29,317 --> 00:02:34,057 ‫In fact, the Docker Desktop that I'm going ‫to recommend you install here, I recommend 40 00:02:34,057 --> 00:02:35,557 ‫you really just stick with that for now. 41 00:02:35,864 --> 00:02:38,174 ‫But if you're someone who already ‫knows a little bit about Docker 42 00:02:38,174 --> 00:02:42,224 ‫and you prefer to just keep it ‫simple, command line only, you could 43 00:02:42,224 --> 00:02:43,874 ‫install the standard Docker Engine. 44 00:02:44,084 --> 00:02:50,234 ‫For that, the next video will focus on ‫Docker Engine for Linux server, because 45 00:02:50,234 --> 00:02:54,344 ‫that's really a command line only ‫solution, and that would be my normal 46 00:02:54,344 --> 00:02:58,999 ‫Linux preferred option for you, until now ‫that we have Docker Desktop for Linux. 47 00:02:58,999 --> 00:03:02,599 ‫So Docker Desktop for Linux is a superset ‫of that, and again, it provides all 48 00:03:02,599 --> 00:03:06,019 ‫those benefits of running in a VM, ‫and it's better isolated and you can 49 00:03:06,019 --> 00:03:07,819 ‫quickly delete it and recreate it. 50 00:03:08,209 --> 00:03:10,339 ‫It automatically updates ‫all the versions of things. 51 00:03:10,339 --> 00:03:15,319 ‫It runs over a VPN, all the things that ‫maybe the raw standard Docker Engine and 52 00:03:15,319 --> 00:03:20,119 ‫command line, which again, next video for ‫that one, they don't necessarily give you. 53 00:03:20,269 --> 00:03:22,009 ‫But you don't have to choose. 54 00:03:22,009 --> 00:03:26,189 ‫You can actually run both on your ‫Docker Desktop if you wanted. 55 00:03:26,519 --> 00:03:28,889 ‫It's going to be a little confusing ‫at first, since you're still 56 00:03:28,889 --> 00:03:32,219 ‫just learning Docker, but you can ‫actually use Docker command line, 57 00:03:32,219 --> 00:03:36,079 ‫something called Docker Context to ‫switch between one or the other. 58 00:03:36,079 --> 00:03:40,909 ‫So you can have your command line control, ‫either the one in the VM with Docker 59 00:03:40,909 --> 00:03:46,146 ‫Desktop, or the one running natively on ‫your host OS, talking to the host kernel. 60 00:03:46,306 --> 00:03:47,026 ‫It's up to you. 61 00:03:47,326 --> 00:03:52,066 ‫I'm going to focus on this video on ‫just Docker Desktop alone, without even 62 00:03:52,066 --> 00:03:54,286 ‫bothering with the host Docker Engine. 63 00:03:54,616 --> 00:03:57,406 ‫I'm going to leave that to the next ‫video, which is more about servers. 64 00:03:58,552 --> 00:04:03,382 ‫Now if you are a Linux desktop ‫user, which probably means you're 65 00:04:03,382 --> 00:04:06,262 ‫pretty good at Linux, like it's ‫probably not your first day on Linux. 66 00:04:06,542 --> 00:04:10,052 ‫You're going to need to pay ‫attention to the details and the 67 00:04:10,052 --> 00:04:12,332 ‫requirements of the setup here. 68 00:04:12,452 --> 00:04:18,457 ‫It's way more steps and it's way more ‫detailed than doing it on Mac or Windows. 69 00:04:18,457 --> 00:04:20,917 ‫It's just the simple ‫nature of Linux desktops. 70 00:04:20,917 --> 00:04:24,517 ‫It's usually more involved, you probably ‫have to install some extra requirements, 71 00:04:24,727 --> 00:04:29,197 ‫you may have to check your host OS and ‫not every Linux distribution will work. 72 00:04:29,467 --> 00:04:33,247 ‫Docker is making it work more ‫and more on various Linux desktop 73 00:04:33,252 --> 00:04:35,587 ‫distributions, but yours may not work. 74 00:04:35,857 --> 00:04:41,077 ‫In this video, I'm focused entirely ‫on Ubuntu, specifically 22.04, the 75 00:04:41,077 --> 00:04:43,617 ‫latest long-term release of Ubuntu. 76 00:04:43,932 --> 00:04:48,917 ‫When you go to the link for this, which ‫is in the resources of this video, you 77 00:04:48,917 --> 00:04:52,427 ‫can find the link to this documentation ‫that will probably change over time. 78 00:04:52,637 --> 00:04:55,487 ‫So maybe yours might work in the future. 79 00:04:55,787 --> 00:05:00,107 ‫At the time of recording this video for ‫example, Mint, one of my favorite desktop 80 00:05:00,107 --> 00:05:06,197 ‫installations of Linux with its cinnamon ‫GUI, does not work with Docker Desktop. 81 00:05:06,197 --> 00:05:10,467 ‫Docker Desktop focuses Gnome ‫desktop features and it does 82 00:05:10,467 --> 00:05:11,787 ‫have some Gnome requirements. 83 00:05:11,917 --> 00:05:14,437 ‫Basically, go read this document ‫because it's going to keep changing 84 00:05:14,437 --> 00:05:19,507 ‫as they get better and better support ‫across the spectrum of Linux desktops. 85 00:05:19,999 --> 00:05:22,999 ‫And you can see here that I had to ‫install some dependencies first. 86 00:05:23,329 --> 00:05:25,999 ‫Really getting just cURL installed ‫was one of the most important 87 00:05:25,999 --> 00:05:30,309 ‫things, because I'll need that ‫during the future install of Docker. 88 00:05:31,089 --> 00:05:34,089 ‫And then down here, I have ‫more of the steps I had to run. 89 00:05:34,089 --> 00:05:39,129 ‫Again, I'm just copying, pasting from ‫the tutorial on Docker's documentation. 90 00:05:39,606 --> 00:05:44,116 ‫And because this is Ubuntu, I'm ‫using apt and specifically, apt-get 91 00:05:44,136 --> 00:05:45,696 ‫to install a lot of this software. 92 00:05:45,726 --> 00:05:48,816 ‫And you can see once I get ‫to the actual Docker Desktop 93 00:05:48,816 --> 00:05:50,646 ‫install, look at all that stuff. 94 00:05:50,946 --> 00:05:54,866 ‫There's lots of packages there ‫required by Docker Desktop. 95 00:05:54,896 --> 00:05:59,786 ‫And that's why it's a little bit harder ‫to make it work in every different 96 00:06:00,086 --> 00:06:04,106 ‫Desktop distribution of Linux, because ‫there's so many libraries here, so 97 00:06:04,106 --> 00:06:08,366 ‫many dependencies, and this really is ‫just showing you how much more Desktop 98 00:06:08,611 --> 00:06:12,001 ‫can do than just Docker Engine alone. 99 00:06:12,293 --> 00:06:16,783 ‫And hopefully once that's successful, ‫you will see this if you search 100 00:06:16,783 --> 00:06:21,643 ‫for Docker in your start menu or ‫whatever Ubuntu's menu is called. 101 00:06:21,853 --> 00:06:24,563 ‫You can just search for it, ‫it'll be an app that you can run. 102 00:06:25,399 --> 00:06:29,029 ‫And as I've said in the other videos ‫for Mac and Windows, that Docker 103 00:06:29,029 --> 00:06:33,079 ‫Desktop, while not technically open ‫source software, though it does come 104 00:06:33,084 --> 00:06:37,489 ‫with some other open source software ‫like Docker Engine and Docker CLI, 105 00:06:37,494 --> 00:06:40,759 ‫which are themselves open source, ‫Docker Desktop itself is not, it 106 00:06:40,759 --> 00:06:42,259 ‫is actually licensed software. 107 00:06:42,379 --> 00:06:44,149 ‫It has some proprietary bits in it. 108 00:06:44,419 --> 00:06:48,589 ‫But the good news here is that it's ‫always free for learning, which I 109 00:06:48,589 --> 00:06:52,669 ‫have verified with management at ‫Docker, that they intend for it 110 00:06:52,674 --> 00:06:56,239 ‫to be free, regardless of who you ‫work for or what company you're on. 111 00:06:56,359 --> 00:06:59,959 ‫If you're allowed by your company or ‫whoever owns your computer to install 112 00:06:59,959 --> 00:07:03,529 ‫it, it is free for this course, it is ‫free while you're learning the tooling. 113 00:07:04,373 --> 00:07:08,543 ‫And once it started the first time, ‫you'll get the licensing agreement 114 00:07:08,543 --> 00:07:14,123 ‫page, then you'll see the "Get Started ‫with Docker" page, which you can step 115 00:07:14,123 --> 00:07:17,543 ‫through this, if you'd like the same ‫as Windows and Mac, or you can just 116 00:07:17,663 --> 00:07:21,383 ‫skip this part and jump into my course, ‫which is the reason you're here, right? 117 00:07:22,310 --> 00:07:25,670 ‫Now that Docker Desktop GUI there ‫will tell you whether or not Docker 118 00:07:25,670 --> 00:07:28,940 ‫is running successfully, but you could ‫also just go to the command terminal 119 00:07:28,940 --> 00:07:33,410 ‫and type in Docker version, like we did ‫the first few videos of this course, 120 00:07:33,500 --> 00:07:37,490 ‫and you'll get back the client-server ‫version, if everything is good. 121 00:07:38,358 --> 00:07:41,868 ‫And a little pro tip here for you, ‫make sure you log into Docker Desktop, 122 00:07:41,868 --> 00:07:46,278 ‫because then that will pass on your ‫authentication to Docker Hub, that's 123 00:07:46,278 --> 00:07:49,368 ‫where you're going to get all the ‫downloads for this course, all the images 124 00:07:49,578 --> 00:07:51,198 ‫that we're going to run inside Docker. 125 00:07:51,248 --> 00:07:54,728 ‫All those images for containers ‫will need to come from Docker 126 00:07:54,728 --> 00:07:56,108 ‫Hub or some other registry. 127 00:07:56,288 --> 00:07:58,958 ‫Most of the time it's Docker Hub, ‫especially when you're first beginning. 128 00:07:59,018 --> 00:08:01,088 ‫And that has pull limits. 129 00:08:01,088 --> 00:08:04,418 ‫We talked about this earlier in other ‫videos, but just make sure you log into 130 00:08:04,423 --> 00:08:08,528 ‫Docker Desktop with your free Docker ‫Hub account, and you don't have to worry 131 00:08:08,528 --> 00:08:11,228 ‫so much about any limits you might hit. 132 00:08:11,378 --> 00:08:14,168 ‫Of course, it's no big deal if you hit ‫them, you just wait a few minutes and try 133 00:08:14,168 --> 00:08:15,983 ‫again, but who wants to deal with that? 134 00:08:16,013 --> 00:08:16,313 ‫Right? 135 00:08:16,313 --> 00:08:17,393 ‫Let's just get to it. 136 00:08:17,663 --> 00:08:22,523 ‫Log in first, it doubles the limits that ‫you have on Docker's free Docker Hub. 137 00:08:23,230 --> 00:08:27,820 ‫And if you try to log in and you get ‫this "Credential store not initialized" 138 00:08:27,820 --> 00:08:31,180 ‫error, like I did, you're going ‫to go through a couple more steps. 139 00:08:31,210 --> 00:08:35,650 ‫Again, welcome to Linux, that ‫get the proper credential storage 140 00:08:36,180 --> 00:08:40,180 ‫solution on your machine to ‫securely store your Docker login. 141 00:08:40,726 --> 00:08:45,646 ‫And the documentation will probably ‫change over the next few months or years. 142 00:08:45,646 --> 00:08:47,746 ‫So I'm going to show ‫you what it was for me. 143 00:08:48,016 --> 00:08:52,481 ‫I simply needed to set up a GPG ‫key, but you may need a few more 144 00:08:52,486 --> 00:08:56,441 ‫steps, or it might be easier for ‫you on yours once Docker solves some 145 00:08:56,441 --> 00:08:57,551 ‫of these problems with automation. 146 00:08:58,263 --> 00:09:03,483 ‫And again, the link for these are in ‫the references for this lecture, but you 147 00:09:03,483 --> 00:09:08,763 ‫will jump over here to documentation and ‫basically run a GPG command to create a 148 00:09:08,768 --> 00:09:16,140 ‫key, and then you'll use the pass tool ‫to use that key and protect your login. 149 00:09:16,550 --> 00:09:20,900 ‫And you'll know that you're done and it's ‫working when you actually click the login 150 00:09:20,900 --> 00:09:24,290 ‫button somewhere in the Docker interface, ‫there's three or four places to click it. 151 00:09:24,530 --> 00:09:27,350 ‫And if you click that and then ‫you get this nice login screen, 152 00:09:27,620 --> 00:09:31,190 ‫that means it's working and you ‫can continue with your Docker ID. 153 00:09:32,060 --> 00:09:35,120 ‫Now that you've logged into Docker ‫and it's working, let's look at the 154 00:09:35,120 --> 00:09:38,730 ‫settings to do a couple of tweaks ‫that you might need for this course. 155 00:09:39,825 --> 00:09:43,055 ‫The easiest way to get to the ‫settings is under that Docker 156 00:09:43,055 --> 00:09:44,945 ‫Moby icon up there at the top. 157 00:09:44,975 --> 00:09:47,435 ‫Remember, his name is ‫Moby, he's the mascot. 158 00:09:47,705 --> 00:09:49,325 ‫Settings are over here, click it. 159 00:09:50,214 --> 00:09:54,684 ‫Because Docker Desktop runs in a ‫VM, you have resources to configure. 160 00:09:54,864 --> 00:09:59,199 ‫Now, Docker has conservative ‫defaults, which means you 161 00:09:59,199 --> 00:10:00,489 ‫probably want to bump them up. 162 00:10:00,699 --> 00:10:04,929 ‫Personally, I don't mind bumping ‫those up to a lot, because I don't 163 00:10:04,929 --> 00:10:06,909 ‫run Docker all day, every day. 164 00:10:06,909 --> 00:10:10,179 ‫When I'm using it, I'm running it ‫and it's using some resources, but 165 00:10:10,179 --> 00:10:14,259 ‫when I'm not using it, I just quit ‫or pause it, and it's not using 166 00:10:14,264 --> 00:10:15,519 ‫really any of these resources. 167 00:10:15,569 --> 00:10:20,789 ‫I usually give it more CPUs and more RAM, ‫somewhere between 6 or 8 gig if I can. 168 00:10:20,969 --> 00:10:22,589 ‫If you don't have that ‫much, don't worry about it. 169 00:10:22,589 --> 00:10:26,669 ‫Just give it enough to make ‫things happy when you run Docker. 170 00:10:26,674 --> 00:10:28,949 ‫And you'll know if things aren't ‫happy, because they'll be either 171 00:10:28,949 --> 00:10:32,099 ‫really slow or you'll get back ‫errors when it runs out of memory. 172 00:10:32,942 --> 00:10:36,752 ‫Now this little setting is an interesting ‫one, because it's similar to what we deal 173 00:10:36,757 --> 00:10:42,797 ‫with on Mac and even Windows, where we're ‫going to be sharing files later from our 174 00:10:42,797 --> 00:10:45,137 ‫host operating system into the containers. 175 00:10:45,407 --> 00:10:48,617 ‫Now, in this case, it's in a virtual ‫machine, which means you're sharing 176 00:10:48,617 --> 00:10:52,997 ‫files from your host, the source ‫code, into a container inside a VM. 177 00:10:52,997 --> 00:10:57,137 ‫So there's some special magic Docker has ‫to do to share across the file systems 178 00:10:57,167 --> 00:10:59,297 ‫of these two different operating systems. 179 00:10:59,682 --> 00:11:03,492 ‫The host into the container inside a VM. 180 00:11:03,732 --> 00:11:06,432 ‫So you want to make sure that ‫the directories where you store 181 00:11:06,432 --> 00:11:08,652 ‫your source code are over there. 182 00:11:09,012 --> 00:11:13,152 ‫And the default includes your home ‫directory, so I just recommend 183 00:11:13,332 --> 00:11:17,382 ‫always clone your code into your ‫home directory on your local machine. 184 00:11:17,472 --> 00:11:18,882 ‫It has the right permissions. 185 00:11:18,882 --> 00:11:22,332 ‫It's automatically set up to share ‫by default, and I just generally 186 00:11:22,332 --> 00:11:23,712 ‫recommend that for all of my code. 187 00:11:23,712 --> 00:11:28,662 ‫And I typically just put ‫it inside /home/bret/code. 188 00:11:28,682 --> 00:11:31,682 ‫I just put everything inside that ‫code directory that I download from 189 00:11:31,892 --> 00:11:33,482 ‫GitHub or any other source code. 190 00:11:34,316 --> 00:11:37,616 ‫Now, if you've heard about VS ‫Code, I think I mentioned it 191 00:11:37,616 --> 00:11:39,636 ‫in every video on this section. 192 00:11:40,146 --> 00:11:43,736 ‫It is my favorite code editor, but you ‫don't have to be a developer to use it. 193 00:11:43,736 --> 00:11:48,716 ‫In fact, I think it's now the best way to ‫edit Infrastructure-as-Code files, DevOps 194 00:11:48,721 --> 00:11:55,181 ‫files, sysadmin files, scripts, anything ‫you might do on the non-dev side of tech. 195 00:11:55,331 --> 00:11:57,641 ‫I still think Visual Studio ‫Code is the best way to do it. 196 00:11:57,791 --> 00:11:59,351 ‫And it runs on every OS. 197 00:11:59,351 --> 00:12:01,451 ‫It runs on Linux, so download that. 198 00:12:02,033 --> 00:12:06,563 ‫And then in a few videos, you'll ‫be seeing my recommendations 199 00:12:06,623 --> 00:12:08,453 ‫on your setup for VS Code. 200 00:12:08,768 --> 00:12:12,608 ‫But really, it's just about extensions, ‫my favorite extensions, which VS 201 00:12:12,608 --> 00:12:15,278 ‫Code will actually just recommend ‫to you when you open the files. 202 00:12:15,278 --> 00:12:17,888 ‫It'll say, Hey, you opened a ‫Terraform file, would you like to 203 00:12:17,893 --> 00:12:19,238 ‫install the Terraform extension? 204 00:12:19,388 --> 00:12:20,978 ‫Or hey, you have Docker installed. 205 00:12:21,098 --> 00:12:22,868 ‫Would you like to install ‫the Docker extension? 206 00:12:23,018 --> 00:12:23,978 ‫It does all that for you. 207 00:12:23,978 --> 00:12:28,058 ‫So really, you don't have to watch ‫my VS Code video, but I do try to 208 00:12:28,058 --> 00:12:29,548 ‫give you a few extra tips there. 209 00:12:30,458 --> 00:12:36,036 ‫And finally, you just want to clone ‫the repo from the course, the lecture 210 00:12:36,036 --> 00:12:40,176 ‫earlier, with all the links in it ‫in this section, for downloading all 211 00:12:40,176 --> 00:12:44,286 ‫the different Docker things you need ‫includes the repo that you want to get. 212 00:12:44,762 --> 00:12:49,282 ‫And you're just going to click that ‫link there, the little green button, 213 00:12:49,282 --> 00:12:53,572 ‫and that'll give you the URL that you ‫would use in a get clone command to 214 00:12:53,722 --> 00:12:57,412 ‫download this entire course repo, which ‫you'll be using throughout the course. 215 00:12:58,456 --> 00:12:59,206 ‫And that's it. 216 00:12:59,536 --> 00:13:02,806 ‫If you're a Linux, Desktop, Desktop ‫user, you should be fully set for 217 00:13:02,906 --> 00:13:06,647 ‫the remainder of this course, with ‫all the tools you need and have fun.