‫macOS and Docker, it's what ‫I've been using since Docker
‫Desktop came out 5+ years ago.
‫And I'm going to walk you through ‫the setup and a few tweaks
‫you might want to check out.
‫In this video, very similar to ‫the Windows one, we have a few
‫steps we need to go through.
‫In Mac, we don't have to worry ‫so much about BIOS settings or
‫virtualization and all that.
‫It just tends to work.
‫That's great.
‫And then we have a Linux shell or a ‫bash and ZSH-type shells already in Mac.
‫So a lot of the requirements for ‫Docker are just to install it.
‫It just works as long as your Mac ‫is, I don't know, at least less than
‫5 years old at this point, 5, 6, 7.
‫It probably goes back, as long as you ‫have one of the last two or three major
‫OSes, Docker tends to support multiple ‫versions of Mac going back in time.
‫So you should be fine there.
‫And I'm mentioning Docker Desktop ‫because it is, I still think, the
‫best way on Mac to run Docker.
‫There are lots of other options out ‫there, but they all have a subset
‫of the features and functionality ‫that Docker Desktop gives you, so I
‫recommend you just stick with the best.
‫And with Mac, you really ‫only get two options here.
‫You're either on an Intel Mac or ‫an Apple M1 Silicon processor.
‫So Apple Silicon, Arm, M1, whatever the ‫term is you want to use for it, if you're
‫using one of those, just make sure you ‫don't download the Intel and you download
‫the M1 version or it may not even work.
‫And of course, like every other Mac ‫app, when you download them from the
‫internet as a DMG, you could just ‫take that little app over there and
‫you copy it into the folder I'm in.
‫And as a reminder, Docker Desktop ‫is always free for learning.
‫Now there's tons of open source throughout ‫this course, nothing in this course,
‫you have to buy, there's nothing in here ‫that you should have to pay for, other
‫than the computer you're running it on.
‫And Docker Desktop does have an Enterprise ‫tier where you will need to pay for it in
‫an enterprise setting for corporate use.
‫But in this case, we are specifically ‫using it for learning and I've gotten
‫permission or verification from ‫the top management at Docker that
‫that's the intention, is that it's ‫free to learn, free for individual
‫use and free for small business.
‫It's only once you get into the ‫enterprise that you need to pay for it.
‫So even if you work in one of those big ‫enterprises and you want to use Docker
‫Desktop for learning, then you're safe.
‫You can read through the user license ‫agreement, but you're going to come
‫to this screen, which is to accept the ‫license and you can read through there.
‫It's mostly to alert you to the licensing ‫change that Docker did a while back that
‫requires enterprises to now pay for it.
‫And Docker likes to bring up its dashboard ‫when it's starting, and this is a GUI that
‫allows you to do some of the things in ‫Docker without having to use the command
‫line, although we will focus largely ‫on the command line in this course.
‫But once it's starting up, you'll see this ‫screen and you'll notice the orange below.
‫That means that Docker or Kubernetes, ‫which you can enable in here, and we'll
‫do that later in the course, these tools ‫will need a startup time because in the
‫background, they're starting a little ‫VM inside of Mac to run a Linux kernel.
‫Mac doesn't run a Linux kernel, it runs a ‫slightly different kernel, based on BSD.
‫And that's not really compatible ‫with Docker, we really need a Linux
‫kernel running in a little VM.
‫So Docker creates a nice, lightweight, ‫low-energy usage VM, which you
‫can also pause from the menu.
‫And when it's finally started, this ‫little bar down here will go green
‫and you'll see some stuff over there.
‫And you'll notice a new icon ‫up here in the menu at the top.
‫Hello.
‫And you'll notice this is the Docker logo.
‫It is actually Moby, he has a name.
‫He also has a pink whale named Molly, ‫which you'll probably hear trivia
‫about throughout this course, but ‫this is the little icon you need
‫to pay attention to, because it's a ‫quick access to the Dashboard to log
‫in, to change the preferences, to ‫pause it when you're not using it,
‫and then to quit it when you're done.
‫And in that menu or in the full ‫dashboard, you'll want to create a
‫free Docker ID at hub.docker.com.
‫And log in there, create that account, ‫get the account ID and password.
‫The account ID is not your email ‫address, it is your account ID.
‫Log into Docker, so when you do that ‫in Docker Desktop, Docker needs to
‫pull the software we're going to run.
‫It's much like a download or like a ‫git clone or git pull, it's going to
‫copy that stuff down off the internet.
‫And you have a number, I think ‫it's somewhere around a hundred per
‫six hours that you can download.
‫And you probably won't download that ‫many in this course, but if you're on
‫a corporate network, that corporate ‫network might have everyone using the
‫same IP to get to the internet, and ‫that's what Docker tracking for downloads.
‫So log in with the free account, it'll ‫give you more downloads per every six
‫hours or whatever their algorithm is.
‫And that just makes sure that you ‫won't get a "download limit exceeded"
‫when you're trying to download apps ‫to load for the rest of this course.
‫Docker has some built-in first steps.
‫You can feel free to do those in this ‫screen here that you're seeing on the
‫dashboard, but you bought this course.
‫So you can also just ignore all of ‫that, close down the dashboard, just
‫click the little red dot the top-left, ‫get rid of that, and then bring up
‫your terminal, because that's what ‫we're really going to use a lot in this
‫course for learning Docker, then Compose ‫and Kubernetes and all the things.
‫Here's a few tweaks and setting changes ‫you might want to do, not just for
‫this course, but for general use.
‫This is typically what I change on ‫Mac when I've installed a fresh Docker
‫Desktop, I want to go change this stuff.
‫Once you go into preferences and ‫you should see the resources area
‫that will allow you to control ‫the number of CPU, RAM, disc,
‫swap, all these settings in Mac.
‫The defaults will get you started, but ‫typically when you start to run more
‫advanced multiple-container workloads that ‫we'll learn later in the course, you might
‫run out of memory, and you might even run ‫out of disk space down here at the bottom.
‫So consider moving these ‫to somewhere higher.
‫I tend to run at least half of the ‫RAM I have in the system, it just
‫depends on how many resources you have.
‫When you start to feel like Docker ‫not working or getting slow, you
‫might want to come in here and see ‫if you need to raise these limits.
‫And don't worry, if Docker is not ‫using them, it won't use them.
‫It won't hog these ‫resources or reserve them.
‫The disk itself over here, actually limits ‫its size to just the files it's using,
‫so you can feel free to ratchet this up.
‫I tend to go 100 to 200 gig depending on ‫how much free space I have, and it will
‫shrink the VM hard drive whenever you're ‫not using it, or whenever it restarts.
‫And right above me tends to be ‫the other thing I like to change,
‫which is experimental features.
‫This will change every year or ‫so once Docker's evolving, but on
‫macOS, since we're running a Linux ‫VM inside of our Mac, there are a few
‫things that Docker has to do in the ‫background to make this all work right.
‫Of course, it's a virtual machine so ‫in this case, I've enabled the new
‫virtualization support in the recent ‫versions of macOS, which is supposed
‫to be a little faster than the older ‫version that Docker used to use.
‫And this one right above me, the ‫VirtualFS, is a new feature in 2022.
‫It may already be out of beta by the ‫time you see this, but that feature I
‫enable because it enhances the speed ‫of my file access when I'm sharing
‫files from my host into the container.
‫You maybe don't understand all ‫this yet, that's totally fine.
‫Just feel free to enable these if ‫you run into any problems, especially
‫around performance and file access.
‫VS Code or Visual Studio Code, if you ‫haven't used it, there's a video later
‫in this section that will explain some ‫of the details on things I like about it.
‫But VS Code is my go-to editor.
‫You don't have to use any specific ‫editor to edit Docker files or Kubernetes
‫files in this course or in general, but ‫Visual Studio Code has Docker add-ins,
‫Compose add-ins, Kubernetes add-ins, ‫all the add-ins for all the tools
‫you're going to learn in this course.
‫So it recognizes the file formats, it ‫highlights the syntax inside the files,
‫and generally is the tool I use every day.
‫You will not be coding in this course, ‫but using a development editor like VS
‫Code does help in DevOps-like tasking for ‫creating Dockerfile's and all the other
‫YAMLs that you will have to deal with.
‫So I recommend it, you'll ‫see more about that later.
‫And just one little feature that ‫I will talk again about later
‫with VS Code, is that it works on ‫Linux desktops, Mac and Windows.
‫You can download it free from Microsoft ‫for all three OS's, and you can sync
‫the settings across all your setups.
‫So I do that in order to have my settings ‫synced on my Mac as well as my Windows
‫machines and a Linux Desktop that I have.
‫Next on your to-do list is to download or ‫clone the course repository from GitHub.
‫And a reference link in this video, as ‫well as a few lectures earlier, that
‫was all the written information, as ‫well as all the links, all in one nice
‫place for you to download this stuff.
‫But you're going to use a git clone ‫command to copy this repository
‫down to your local machine.
‫So you have all the sample files that ‫you'll need throughout this course.
‫And that's it.
‫You've got Docker, Desktop installed.
‫You've got VS Code or ‫your favorite editor.
‫You can use whatever editor you want, but ‫I will be using VS Code in this course.
‫You've got Mac's built in terminal ‫that you can use for all the commands.
‫We're gonna be typing and you've cloned ‫the repository down somewhere in your
‫user directory, and you're ready to rock.
‫Let's get going.