Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
Are you a Mac user and ready to use Docker?
Well this lecture is going to get you all the tools you need to use this course with Docker and to get
the best Docker setup on your Mac.
The nice thing is I'm going to be using all the demos, or at least most of the demos, on my Mac. So
it'll feel very native for you.
The required version of Mac isn't actually even recent. So you probably will be on the minimum version.
It's actually a three-year old OS at this point on Yosemite. Really, Yosemite works on every Mac hardware
for the last 10 years.
So as long as your laptop is less than 10 years old and you're using a version of Mac that was released
in the last three years, the Docker for Mac product that you can get from store.docker.com will work.
And it's the best way to use Docker on your Mac.
It has all the features and all the new bonus, sort of ease-of-use things going on in terms of like networking
and storage and stuff.
And we'll get into that.
But that's really the best way to go. If for some reason you can't do that,
maybe your office that you use your Mac from, it requires Mavericks or one of the older versions like
line or something.
That's OK. There's still an option known as Docker Toolbox, which is sort of the legacy...
it was actually the only version of Docker we could use on a Mac
up until mid 2016 when they created Docker for Mac.
So Docker Toolbox is still supported, still got the latest versions of Docker in it.
It's just not going to have all of the nice little extra features and performance benefits of Docker
for Mac.
Other options for using Docker on your Mac include just installing it in a Linux VM.
I mean, however you want to create a VM, do that, whether it's locally with VirtualBox or VMWare Fusion
or Parallels or installing it on a Linux VM on the Internet on the cloud...
you know, right on AWS or Azure or DigitalOcean.
Wherever you can get a Linux VM installed, you just can install Docker on that and you can do 98%
of this course that way.
Other options include actually installing Docker in a Windows VM on your Mac.
That might sound kind of weird.
It's like too many layers of stuff going on. Right? And actually that requires something called nested
virtualization.
So I don't really recommend it.
I won't support it in this course really. I won't talk about it.
It is possible to make it work in case you, for some reason, just want to run Docker on a Windows machine
on your Mac.
I personally just do that for testing and demo purposes, but if you want to do that, it works with
Vmware Fusion.
It does require a little special setting for nested virtualization, which means virtualization inside
of virtualization.
So you've got to get that working.
But I'm told by the Docker team that it does work. The last little option here, or tidbit I guess,
is that don't use Homebrew to install Docker.
If you've actually already done that, you need to uninstall that Docker, because what that is is the command
line only.
It's not going to actually have the Docker server or any of the other features that Docker comes with.
It's only going to have the Docker command line tool. That's useful if you want to use Docker to
talk to a server remotely.
But we're not going to do a whole lot of that in this course.
We're going to focus on using Docker on your machine.
The set up process is going to basically go like this
in this lecture. We're going to actually install Docker and then check out some of the settings or preferences
for Docker for Mac and tweak those a little bit. Then we're going to download my GitHub repo that
you're going to need in this course,
with all of the code samples and stuff. Then we're going to talk about code editors, and I prefer a specific
one, Visual Studio Code, just because it works really well with Docker.
But just about any one will work, whatever favorite one you use will work fine.
Then we're going to show some optional things where maybe you want to tweak your terminal or your
shell setup in your Mac so that it works easier from the command line if you're going to be doing Docker
stuff all day long.
OK. Let's get started with the install.
Go to store.docker.com. As you can see, I'm already there. Everything in this course is
focused on the free version, or the Docker Community Edition, Docker CE.
When this interface changes, because all interfaces changes on the web, right, you're going to have
to find the Docker CE download area. You'll see that there is an edition for all sorts of different
OS's. We're going to look for the Mac one, which happens to be at the top. Over here on the right,
I had this "Get" download. Now you can just click this but you'll notice that
also if you're if you're an older version of Mac, it'll tell you 'hey the backup option is Docker
Toolbox.'
But if we scroll down a little bit, we get two options and I'm going to use the Edge version.
The Edge is kind of like a beta and I'm of course a tester so I like testing the software and I'd prefer
to see the new features first. But I find Edge actually to be quite stable.
And with this product only being like a year old, I actually find that it gets the things I need, the
new features or bug fixes, faster as well. So I don't know,
your experience may vary and so generally I tell people if you're in an enterprise environment and you're
looking to have your whole team on exactly the same version that you have in production and to sort
of match all that up, then I'd say stick with Stable. For everyone else,
I say give Edge a shot and if at any time you want to change these two it's actually super easy in the
interface to change,
built in, from Stable back to Edge and back and forth.
So I'm going to do the Edge. And we're going to run that DMG file.
It should open up a screen that allows you to drag the Docker app into your applications folder
like a typical Mac would. It'll copy that over and allow you to run it. So you can close this window.
You can actually close the web browser and go launch Docker.
Now the first time you run it it'll give you this warning just simply because you're downloading it
over the Internet and not from the Apple store.
So go ahead and click Open, but you won't get that after that.
Now we're going to walk through the setup process.
It's really easy.
We're just going to click Next and it's going to ask us for root privileges, and then we're going to
get a nice set up menu and one of the options is you can sign in and create a Docker ID. It actually
gives you some neat cloud services that we'll talk later in this course.
But you don't have to do that right now.
That's not a requirement.
We're just going to wait for it to start and you'll see at the top it says 'Docker is now running.'
You'll notice that it gives me a menu bar icon, so I can get lots of options from here including
everything from checking for updates to restarting Docker, to exiting Docker, and by default this thing
will start
every time your computer starts when you log in. And away we go.
Before we go any further, I want to talk about a few preferences that you might want to change.
One of them is I mentioned the option of switching between the Edge and the Stable versions in case
maybe you ever have an issue with Edge.
You can actually do that here, and it will sort of remove your Docker VM and then create a new one, but
so you don't want to do this every day, but in case you have a bug and you think maybe there's something
to do with the Edge version, you can always switch back to Stable.
Second thing is whenever you're working with code that's on your host machine and you want to work with
it in a Docker container.
This is known as bind mounting.
We'll talk a lot about that later.
But for now just remember that when we get to that section, you need to make sure that your code, whatever
you're going to use, is in one of these volumes or one of these directories on your Mac I should say.
So really for me, I just make sure that my code is inside my user directories, and for me that's
/Users /Bret.
For you, it's probably your user name after the users and so you notice that that's already
in here.
But if you're a someone who makes a custom root directory on your Mac, you're going to need to add that
in here with the plus symbol.
Docker is actually on a Mac running a tiny VM in the background.
It's running a tiny Linux VM and that's because Docker doesn't run natively on the Mac kernel.
Apple hasn't actually built in Docker functionality into its OS kernel. So we have to run this tiny
little VM.
If you've ever run any virtualization, you know that you can give it however many CPUs and however
much RAM. And, I normally leave mine at the 2 CPUs of the 4 on my laptop, and then I usually ramp my
RAM up to like let's say 4.
You don't have to do that.
It all depends on how much memory is in your system.
I happen to have 16GB of RAM on my Mac so I have plenty of room to give it more access in Mac or in
the Docker preferences.
Do note though, that Docker won't actually take up all of that RAM unless it needs it.
So it's nice and conservative.
That's the same thing with the space too.
On the hard drive, it won't take up a huge amount of space it will only grow as it needs to.
So just because you're giving it 4GB of RAM doesn't mean that it's not able to share that
RAM with other applications on your Mac.
It just means that Docker can use up to 4GB of memory on my computer. Over here I have to click
Apply and Restart,
now that I've made that change. There's lots of other options you can look at here and read about
and actually see the Help on inside the menu.
But for now let's just get into the command line.
So I'm going to bring up the terminal.
It's actually called Terminal, it's the Mac application. And if you're familiar with this you may have
all your own setup.
If you're not familiar with Terminal, it is like PowerShell or command prompt in Windows and like a
standard Linux shell in Linux. It actually, by default,
runs Bash, which is just a standard shell, very common. You can see that it's here at the top. I can
actually run Docker version here
to know that my Docker is running,
and which version of Docker I've got running here. So you can see the client and the server are both
listed, and we'll talk in the next lecture after this section about what all that stuff means but this
basically getting this back does mean that your Docker is working and you can talk to it.
Now that we know that Docker is installed and working correctly, let's clone my repository for this
course. If you're used to Git and GitHub, then this is a super easy part that you probably have done
lots of times in your career.
Probably just this week and it's no big deal.
But if you're new to Git or specifically to GitHub, then let me just drop you through a couple of quick
steps on the easiest way to get my repository downloaded.
In a previous lecture in this section, I gave you some information about where to find my repository
and the link to it.
It's at github.com/bretfisher/udemy-docker-mastery.
That's a lot to type.
So check out the previous lecture on cloning the class repository and that'll get you to this directory.
Right in here is basically you can actually view it on the web but we need the whole thing on our
local computer. So you would normally on GitHub come over here to the clone and download area and I
don't recommend you download the zip.
The reason is is that this course is fluid. Right?
Docker is always changing, they're always updating and so this course will be as well. And you'll actually
notice, even on this page, you'll notice that something changed
less than a month ago, something changed two months ago. So things are fluid, and if you download a zip,
it's not easy to update it once you're in the course.
But if you open it in the desktop, it'll actually open it in the GitHub GUI and let you keep it in
sync doing
a get pull on occasion. And GitHub now has a new desktop and once you've downloaded and installed
that, you can actually jump back over my repository and use several different options.
You can click the Open in Desktop, which will open it in the GUI for GitHub, or you can copy the link
and manually paste it into this GUI and then you can put it on your local machine.
The one important part here is that you want to make sure that you're putting it inside your user directory.
So /users/bret is my user directory on my Mac and I just have a default standard of
I put everything inside a code directory.
The settings for Docker as we mentioned previously, want to make sure that you have all the locations
on your hard drive where you might put code that is going to be used inside a container.
I won't cover that all again but if you make sure that it's inside your user directory, then you're
good to go.
Once you've downloaded it, I would probably do a git pull once a month or so while you're still working
on the course to make sure that you have all the latest fixes and updates as this course evolves.
While we're on the topic of this terminal, this terminal works great.
You can use it your whole career. There are lots of people that's been all day long in this particular
terminal application.
But in this course you'll see me use one with a few more features known as iTerm2.
And you can find that at
iterm2.com
It's actually open source and free.
And I actually donate money to them because I use it so often
and there's one gentleman that actually develops it and I really like it.
So from here you're going to click the download and install it just like you would every other Mac application.
You can see that I have it here running on the right and then I have the terminal actually running
on the left. I can do docker version on this right side.
Really, honestly, the only thing that I have different on my iTerm2 versus the standard terminal
is I've customized it.
I've changed the colors.
I've changed the shell and the options in there.
You can actually find more out about that at bretfisher.com/shell.
That'll come at the end of this lecture. I'll mention that again so you know where to go find it.
But there's lots of little things and tweaks and stuff I do that you can go get.
As a reminder, none of that is required for this course.
You can use a default terminal and the default CLI just like this through the entire course and it'll work
just fine.
The next little tip I want to give you is to check out Visual Studio Code.
If you don't have a preferred editor, you can check out Visual Studio Code.
It's actually a free version of a code editor from Microsoft that's very similar to Atom from GitHub
if you've ever use that.
But it actually comes out-of-the-box with a lot more functionality.
One of the nice things is it has a Docker feature that you can actually download as an extension.
You'll see that I have downloaded and installed it already.
And under this button on the left, there's an extensions option, and you can see that I have some basics
like a spell checker.
The Docker one, which is actually really handy in this course, it helps you with Dockerfiles and Compose
files that you will learn about, and it gives you syntax highlighting and you'll see that commonly throughout
this course. I actually have a few other ones in there for different languages and tools. But really
just the Docker one is the one that I recommend for this course.
The last little thing we're going to go through is actually the command tab completion.
I'm going to bring up a new tab, and I'll give you the link in the end of this lecture and also in
the resources for this lecture.
Docker has some great documentation on how to get the Bash completion working and what
that really looks like is when I'm in a shell...let me make this a little bigger for you...and I start typing
a Docker command, docker container, I get...if I hit Tab, I get the options of what I can type. It helps
me complete Docker commands so I can do something like this and hit Tab again and I get a bunch of the options.
You can do this on your system too.
And we can do that real quick simply by copying this after we do a few things and all the instructions
are here.
The first thing is it says to use Homebrew. Well, what is Homebrew? If you're not familiar with Homebrew,
it's actually a another tool.
This, by the way again, all optional.
You can download it from the Homebrew website which is brew.sh. What it is is a command line
tool that helps you install open source command line utilities with a one liner.
It's very similar to apt-get on Linux. PowerShell also has one on Windows. Basically, once you have
it installed, you can just type brew install something, and it and it will go get that.
In this case, what they're saying is that you need to make sure you have the bash completion.
So let's go through that real quick.
First, install Homebrew using this command line right here which I already have on my machine, but
it will install the Homebrew application. Then from that terminal window...let me enlarge it for you...you
can actually type brew install bash completion.
When I do that, it's actually going to download the bash completion and automatically set it up on
my machine.
Now I already have that installed,
so when I hit Enter, it's actually going to just tell me that it's already there but for you it will
actually install the bash completion and set it up so that you're good to go.
Yeah it says it's already installed. Let me clear my screen here.
Then the next step is to actually link these three resources into your terminals.
I'm just going to copy and paste that.
Those three lines will make permanent links. That way, when I type
now docker container run -- and hit Tab, you'll see that it gives me all the options again.
I can also start from the very beginning and just type docker and hit Tab twice to get all the options
here, or I can type part of one and hit Tab and it will automatically complete it for me.
Basically, I'm hitting Tab all the time.
Right.
That's known as tab completion.
It works out-of-the-box in a lot of Linux distributions but that's how you get it set up on Docker.
I brought that into this lecture because a lot of people originally were asking me how to get that working
and the Docker documentation is pretty good on getting that started.
OK.
To sum up this lecture, let's cover a few of the tips that I just talked about and also give you a couple
of extra ones before we get started.
The command completion for your shell is totally optional but it will help you.
This link will actually be in the top left of your screen under the resources and then you can jump
over to the Docker documentation for that.
We talked about where to store your code for the samples and the work you're going to be doing in Docker.
I recommend just sticking it inside /users/your user name on your Mac.
That's the easiest place to do it.
But if you do it somewhere else, you have to change the settings.
And when you do that, we're going to get into the bind mount thing later but just realize that you probably
shouldn't use the bind mounts for databases. Really just use it for software code.
That's really what it's meant for
and it works the best with.
Next one is we didn't talk about this at all.
We will later in the course. Docker Machine allows you to create virtual machines on the fly with Docker
built into them. You can use that to create machines and manage them very easily, either locally on
your Mac with something like VirtualBox, or even on the Internet with Azure or DigitalOcean.
So do check that out if you're interested in that.
It's not required for this course, but it is yet another way that you can use Docker and manage it pretty
quickly.
We talked about the code editor for this course.
I'm going to be using Visual Studio Code a lot.
I will also sometimes use Vim, but you can use whatever you want.
There is no requirement for anything specific.
It's really just text files
we're gonna be editing. Then we talked about iTerm2 as a potential replacement for Terminal.
I know lots of people that are professionals that use Terminal all day long.
They're fine with it.
I just happen to like some of the features in iTerm2.
And so hopefully you will too.
It's open source and it's great stuff.
If you have any problems with your installation, definitely check out the docs at Docker's website.
That link is fantastic.
There is so much information there.
I personally recommend you just read it eventually because you'll learn more things about your Docker
install on your Mac and how the Mac works with it.
And lastly, my specific shell setup that I'm going to be using in this course happens to be the ITerm2,
plus not using the bash shell, it's something called Oh-My-Zsh.
Then I have a lot of other things.
I change the colors.
I have a little whale emoji in there.
I do lots of stuff, right, but that's not going to distract you from the course. Don't think that
you have to have all those things set up.
But I do get a lot of questions from people on how my cool little shell is set up and I do spend an
obsessive amount of time trying to figure that thing out and make it perfect.
Do check out if you're interested in any of those add-ons.
bretfisher.com/shell. I do list everything that I currently use in my shell setup in there
and someday I might make a full video on how to set each one of those up.
But for now it's really just a list of links and information about them. OK.
I hope you got Docker for Mac set up the just the way you want it and it's working great.
If you have to use Docker Toolbox for the legacy option on Mac, do check out the lecture on Docker
Toolbox for Windows.
I know it's not Mac, obviously, but the toolbox works the same way on Windows and on Macs so that lecture
will actually teach you how to use the toolbox
if you have to. But if you don't have to, I highly recommend the Docker for Mac. Get it all set up and get the
terminal working, and then jump to the next section to get started right now with Docker.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.