1 00:00:01,370 --> 00:00:04,890 ‫macOS and Docker, it's what ‫I've been using since Docker 2 00:00:04,890 --> 00:00:07,470 ‫Desktop came out 5+ years ago. 3 00:00:07,830 --> 00:00:10,860 ‫And I'm going to walk you through ‫the setup and a few tweaks 4 00:00:10,860 --> 00:00:11,580 ‫you might want to check out. 5 00:00:11,953 --> 00:00:14,863 ‫In this video, very similar to ‫the Windows one, we have a few 6 00:00:14,868 --> 00:00:16,153 ‫steps we need to go through. 7 00:00:16,633 --> 00:00:20,143 ‫In Mac, we don't have to worry ‫so much about BIOS settings or 8 00:00:20,143 --> 00:00:21,643 ‫virtualization and all that. 9 00:00:21,643 --> 00:00:22,873 ‫It just tends to work. 10 00:00:23,113 --> 00:00:23,653 ‫That's great. 11 00:00:23,653 --> 00:00:30,223 ‫And then we have a Linux shell or a ‫bash and ZSH-type shells already in Mac. 12 00:00:30,403 --> 00:00:34,153 ‫So a lot of the requirements for ‫Docker are just to install it. 13 00:00:34,963 --> 00:00:39,868 ‫It just works as long as your Mac ‫is, I don't know, at least less than 14 00:00:39,868 --> 00:00:42,278 ‫5 years old at this point, 5, 6, 7. 15 00:00:42,298 --> 00:00:45,718 ‫It probably goes back, as long as you ‫have one of the last two or three major 16 00:00:45,718 --> 00:00:50,578 ‫OSes, Docker tends to support multiple ‫versions of Mac going back in time. 17 00:00:50,578 --> 00:00:51,718 ‫So you should be fine there. 18 00:00:52,738 --> 00:00:55,858 ‫And I'm mentioning Docker Desktop ‫because it is, I still think, the 19 00:00:55,858 --> 00:00:57,958 ‫best way on Mac to run Docker. 20 00:00:58,198 --> 00:01:02,398 ‫There are lots of other options out ‫there, but they all have a subset 21 00:01:02,788 --> 00:01:06,718 ‫of the features and functionality ‫that Docker Desktop gives you, so I 22 00:01:07,018 --> 00:01:08,848 ‫recommend you just stick with the best. 23 00:01:10,036 --> 00:01:12,346 ‫And with Mac, you really ‫only get two options here. 24 00:01:12,346 --> 00:01:17,386 ‫You're either on an Intel Mac or ‫an Apple M1 Silicon processor. 25 00:01:17,386 --> 00:01:22,951 ‫So Apple Silicon, Arm, M1, whatever the ‫term is you want to use for it, if you're 26 00:01:22,951 --> 00:01:26,401 ‫using one of those, just make sure you ‫don't download the Intel and you download 27 00:01:26,401 --> 00:01:29,281 ‫the M1 version or it may not even work. 28 00:01:30,145 --> 00:01:33,645 ‫And of course, like every other Mac ‫app, when you download them from the 29 00:01:33,645 --> 00:01:37,195 ‫internet as a DMG, you could just ‫take that little app over there and 30 00:01:37,200 --> 00:01:38,905 ‫you copy it into the folder I'm in. 31 00:01:39,957 --> 00:01:43,557 ‫And as a reminder, Docker Desktop ‫is always free for learning. 32 00:01:43,677 --> 00:01:47,337 ‫Now there's tons of open source throughout ‫this course, nothing in this course, 33 00:01:47,337 --> 00:01:50,672 ‫you have to buy, there's nothing in here ‫that you should have to pay for, other 34 00:01:50,672 --> 00:01:52,142 ‫than the computer you're running it on. 35 00:01:52,502 --> 00:01:57,636 ‫And Docker Desktop does have an Enterprise ‫tier where you will need to pay for it in 36 00:01:57,636 --> 00:01:59,346 ‫an enterprise setting for corporate use. 37 00:01:59,556 --> 00:02:03,846 ‫But in this case, we are specifically ‫using it for learning and I've gotten 38 00:02:03,846 --> 00:02:09,216 ‫permission or verification from ‫the top management at Docker that 39 00:02:09,216 --> 00:02:13,046 ‫that's the intention, is that it's ‫free to learn, free for individual 40 00:02:13,046 --> 00:02:14,906 ‫use and free for small business. 41 00:02:15,086 --> 00:02:17,276 ‫It's only once you get into the ‫enterprise that you need to pay for it. 42 00:02:17,276 --> 00:02:20,666 ‫So even if you work in one of those big ‫enterprises and you want to use Docker 43 00:02:20,666 --> 00:02:23,426 ‫Desktop for learning, then you're safe. 44 00:02:23,426 --> 00:02:28,106 ‫You can read through the user license ‫agreement, but you're going to come 45 00:02:28,335 --> 00:02:32,385 ‫to this screen, which is to accept the ‫license and you can read through there. 46 00:02:32,385 --> 00:02:36,945 ‫It's mostly to alert you to the licensing ‫change that Docker did a while back that 47 00:02:36,945 --> 00:02:38,745 ‫requires enterprises to now pay for it. 48 00:02:40,015 --> 00:02:44,335 ‫And Docker likes to bring up its dashboard ‫when it's starting, and this is a GUI that 49 00:02:44,335 --> 00:02:48,175 ‫allows you to do some of the things in ‫Docker without having to use the command 50 00:02:48,175 --> 00:02:51,355 ‫line, although we will focus largely ‫on the command line in this course. 51 00:02:51,445 --> 00:02:55,225 ‫But once it's starting up, you'll see this ‫screen and you'll notice the orange below. 52 00:02:55,225 --> 00:02:59,365 ‫That means that Docker or Kubernetes, ‫which you can enable in here, and we'll 53 00:02:59,365 --> 00:03:03,295 ‫do that later in the course, these tools ‫will need a startup time because in the 54 00:03:03,295 --> 00:03:08,155 ‫background, they're starting a little ‫VM inside of Mac to run a Linux kernel. 55 00:03:08,545 --> 00:03:14,260 ‫Mac doesn't run a Linux kernel, it runs a ‫slightly different kernel, based on BSD. 56 00:03:14,530 --> 00:03:18,190 ‫And that's not really compatible ‫with Docker, we really need a Linux 57 00:03:18,536 --> 00:03:20,524 ‫kernel running in a little VM. 58 00:03:20,529 --> 00:03:25,744 ‫So Docker creates a nice, lightweight, ‫low-energy usage VM, which you 59 00:03:25,744 --> 00:03:27,884 ‫can also pause from the menu. 60 00:03:28,308 --> 00:03:31,958 ‫And when it's finally started, this ‫little bar down here will go green 61 00:03:32,228 --> 00:03:34,118 ‫and you'll see some stuff over there. 62 00:03:34,694 --> 00:03:38,174 ‫And you'll notice a new icon ‫up here in the menu at the top. 63 00:03:38,204 --> 00:03:38,744 ‫Hello. 64 00:03:39,074 --> 00:03:42,164 ‫And you'll notice this is the Docker logo. 65 00:03:42,164 --> 00:03:44,849 ‫It is actually Moby, he has a name. 66 00:03:44,939 --> 00:03:49,739 ‫He also has a pink whale named Molly, ‫which you'll probably hear trivia 67 00:03:49,739 --> 00:03:52,589 ‫about throughout this course, but ‫this is the little icon you need 68 00:03:52,594 --> 00:03:56,369 ‫to pay attention to, because it's a ‫quick access to the Dashboard to log 69 00:03:56,369 --> 00:04:01,169 ‫in, to change the preferences, to ‫pause it when you're not using it, 70 00:04:01,169 --> 00:04:02,519 ‫and then to quit it when you're done. 71 00:04:03,083 --> 00:04:07,103 ‫And in that menu or in the full ‫dashboard, you'll want to create a 72 00:04:07,103 --> 00:04:10,813 ‫free Docker ID at hub.docker.com. 73 00:04:11,123 --> 00:04:16,313 ‫And log in there, create that account, ‫get the account ID and password. 74 00:04:16,403 --> 00:04:20,753 ‫The account ID is not your email ‫address, it is your account ID. 75 00:04:20,973 --> 00:04:25,353 ‫Log into Docker, so when you do that ‫in Docker Desktop, Docker needs to 76 00:04:25,353 --> 00:04:26,943 ‫pull the software we're going to run. 77 00:04:27,093 --> 00:04:31,873 ‫It's much like a download or like a ‫git clone or git pull, it's going to 78 00:04:31,983 --> 00:04:34,023 ‫copy that stuff down off the internet. 79 00:04:34,293 --> 00:04:37,863 ‫And you have a number, I think ‫it's somewhere around a hundred per 80 00:04:37,868 --> 00:04:39,663 ‫six hours that you can download. 81 00:04:39,933 --> 00:04:42,873 ‫And you probably won't download that ‫many in this course, but if you're on 82 00:04:42,873 --> 00:04:46,083 ‫a corporate network, that corporate ‫network might have everyone using the 83 00:04:46,083 --> 00:04:50,793 ‫same IP to get to the internet, and ‫that's what Docker tracking for downloads. 84 00:04:50,973 --> 00:04:56,253 ‫So log in with the free account, it'll ‫give you more downloads per every six 85 00:04:56,253 --> 00:04:58,173 ‫hours or whatever their algorithm is. 86 00:04:58,513 --> 00:05:01,968 ‫And that just makes sure that you ‫won't get a "download limit exceeded" 87 00:05:01,968 --> 00:05:05,298 ‫when you're trying to download apps ‫to load for the rest of this course. 88 00:05:05,714 --> 00:05:08,054 ‫Docker has some built-in first steps. 89 00:05:08,084 --> 00:05:11,774 ‫You can feel free to do those in this ‫screen here that you're seeing on the 90 00:05:11,774 --> 00:05:14,054 ‫dashboard, but you bought this course. 91 00:05:14,174 --> 00:05:19,424 ‫So you can also just ignore all of ‫that, close down the dashboard, just 92 00:05:19,604 --> 00:05:22,694 ‫click the little red dot the top-left, ‫get rid of that, and then bring up 93 00:05:22,694 --> 00:05:25,094 ‫your terminal, because that's what ‫we're really going to use a lot in this 94 00:05:25,094 --> 00:05:30,034 ‫course for learning Docker, then Compose ‫and Kubernetes and all the things. 95 00:05:30,263 --> 00:05:34,668 ‫Here's a few tweaks and setting changes ‫you might want to do, not just for 96 00:05:34,668 --> 00:05:36,498 ‫this course, but for general use. 97 00:05:36,588 --> 00:05:41,058 ‫This is typically what I change on ‫Mac when I've installed a fresh Docker 98 00:05:41,058 --> 00:05:43,118 ‫Desktop, I want to go change this stuff. 99 00:05:43,315 --> 00:05:47,735 ‫Once you go into preferences and ‫you should see the resources area 100 00:05:47,915 --> 00:05:51,305 ‫that will allow you to control ‫the number of CPU, RAM, disc, 101 00:05:51,335 --> 00:05:53,405 ‫swap, all these settings in Mac. 102 00:05:53,655 --> 00:05:57,345 ‫The defaults will get you started, but ‫typically when you start to run more 103 00:05:57,345 --> 00:06:02,930 ‫advanced multiple-container workloads that ‫we'll learn later in the course, you might 104 00:06:02,930 --> 00:06:07,940 ‫run out of memory, and you might even run ‫out of disk space down here at the bottom. 105 00:06:07,940 --> 00:06:11,330 ‫So consider moving these ‫to somewhere higher. 106 00:06:11,335 --> 00:06:14,930 ‫I tend to run at least half of the ‫RAM I have in the system, it just 107 00:06:14,930 --> 00:06:16,520 ‫depends on how many resources you have. 108 00:06:17,030 --> 00:06:20,600 ‫When you start to feel like Docker ‫not working or getting slow, you 109 00:06:20,600 --> 00:06:24,223 ‫might want to come in here and see ‫if you need to raise these limits. 110 00:06:24,638 --> 00:06:28,298 ‫And don't worry, if Docker is not ‫using them, it won't use them. 111 00:06:28,303 --> 00:06:31,538 ‫It won't hog these ‫resources or reserve them. 112 00:06:31,778 --> 00:06:36,998 ‫The disk itself over here, actually limits ‫its size to just the files it's using, 113 00:06:37,141 --> 00:06:39,361 ‫so you can feel free to ratchet this up. 114 00:06:39,366 --> 00:06:44,791 ‫I tend to go 100 to 200 gig depending on ‫how much free space I have, and it will 115 00:06:45,041 --> 00:06:50,711 ‫shrink the VM hard drive whenever you're ‫not using it, or whenever it restarts. 116 00:06:51,372 --> 00:06:54,402 ‫And right above me tends to be ‫the other thing I like to change, 117 00:06:54,522 --> 00:06:55,902 ‫which is experimental features. 118 00:06:55,912 --> 00:07:00,772 ‫This will change every year or ‫so once Docker's evolving, but on 119 00:07:01,242 --> 00:07:06,592 ‫macOS, since we're running a Linux ‫VM inside of our Mac, there are a few 120 00:07:06,592 --> 00:07:10,822 ‫things that Docker has to do in the ‫background to make this all work right. 121 00:07:10,852 --> 00:07:14,242 ‫Of course, it's a virtual machine so ‫in this case, I've enabled the new 122 00:07:14,242 --> 00:07:18,652 ‫virtualization support in the recent ‫versions of macOS, which is supposed 123 00:07:18,742 --> 00:07:22,462 ‫to be a little faster than the older ‫version that Docker used to use. 124 00:07:22,752 --> 00:07:27,672 ‫And this one right above me, the ‫VirtualFS, is a new feature in 2022. 125 00:07:27,912 --> 00:07:33,072 ‫It may already be out of beta by the ‫time you see this, but that feature I 126 00:07:33,077 --> 00:07:38,382 ‫enable because it enhances the speed ‫of my file access when I'm sharing 127 00:07:38,382 --> 00:07:40,122 ‫files from my host into the container. 128 00:07:40,542 --> 00:07:42,912 ‫You maybe don't understand all ‫this yet, that's totally fine. 129 00:07:43,122 --> 00:07:46,602 ‫Just feel free to enable these if ‫you run into any problems, especially 130 00:07:46,642 --> 00:07:49,272 ‫around performance and file access. 131 00:07:49,593 --> 00:07:54,603 ‫VS Code or Visual Studio Code, if you ‫haven't used it, there's a video later 132 00:07:54,603 --> 00:07:58,413 ‫in this section that will explain some ‫of the details on things I like about it. 133 00:07:58,623 --> 00:08:01,413 ‫But VS Code is my go-to editor. 134 00:08:01,413 --> 00:08:05,733 ‫You don't have to use any specific ‫editor to edit Docker files or Kubernetes 135 00:08:05,733 --> 00:08:11,493 ‫files in this course or in general, but ‫Visual Studio Code has Docker add-ins, 136 00:08:12,018 --> 00:08:15,658 ‫Compose add-ins, Kubernetes add-ins, ‫all the add-ins for all the tools 137 00:08:15,658 --> 00:08:16,848 ‫you're going to learn in this course. 138 00:08:16,968 --> 00:08:21,880 ‫So it recognizes the file formats, it ‫highlights the syntax inside the files, 139 00:08:22,106 --> 00:08:24,446 ‫and generally is the tool I use every day. 140 00:08:24,746 --> 00:08:30,356 ‫You will not be coding in this course, ‫but using a development editor like VS 141 00:08:30,356 --> 00:08:36,776 ‫Code does help in DevOps-like tasking for ‫creating Dockerfile's and all the other 142 00:08:36,776 --> 00:08:38,516 ‫YAMLs that you will have to deal with. 143 00:08:38,756 --> 00:08:41,076 ‫So I recommend it, you'll ‫see more about that later. 144 00:08:41,796 --> 00:08:44,811 ‫And just one little feature that ‫I will talk again about later 145 00:08:44,811 --> 00:08:49,351 ‫with VS Code, is that it works on ‫Linux desktops, Mac and Windows. 146 00:08:49,351 --> 00:08:53,711 ‫You can download it free from Microsoft ‫for all three OS's, and you can sync 147 00:08:53,711 --> 00:08:55,971 ‫the settings across all your setups. 148 00:08:55,991 --> 00:09:00,861 ‫So I do that in order to have my settings ‫synced on my Mac as well as my Windows 149 00:09:00,861 --> 00:09:03,061 ‫machines and a Linux Desktop that I have. 150 00:09:03,722 --> 00:09:09,352 ‫Next on your to-do list is to download or ‫clone the course repository from GitHub. 151 00:09:09,839 --> 00:09:15,149 ‫And a reference link in this video, as ‫well as a few lectures earlier, that 152 00:09:15,149 --> 00:09:18,749 ‫was all the written information, as ‫well as all the links, all in one nice 153 00:09:18,749 --> 00:09:20,729 ‫place for you to download this stuff. 154 00:09:21,029 --> 00:09:25,529 ‫But you're going to use a git clone ‫command to copy this repository 155 00:09:25,529 --> 00:09:26,849 ‫down to your local machine. 156 00:09:26,999 --> 00:09:30,119 ‫So you have all the sample files that ‫you'll need throughout this course. 157 00:09:30,823 --> 00:09:31,633 ‫And that's it. 158 00:09:31,873 --> 00:09:33,853 ‫You've got Docker, Desktop installed. 159 00:09:34,003 --> 00:09:36,583 ‫You've got VS Code or ‫your favorite editor. 160 00:09:36,643 --> 00:09:40,423 ‫You can use whatever editor you want, but ‫I will be using VS Code in this course. 161 00:09:40,663 --> 00:09:44,713 ‫You've got Mac's built in terminal ‫that you can use for all the commands. 162 00:09:44,713 --> 00:09:49,093 ‫We're gonna be typing and you've cloned ‫the repository down somewhere in your 163 00:09:49,093 --> 00:09:51,553 ‫user directory, and you're ready to rock. 164 00:09:51,553 --> 00:09:52,363 ‫Let's get going.