‫Alright, since this is the first lecture in this section, I'm going to cover real quick what this whole
‫section is about and that's containers.
‫Containers are the fundamental building block of the Docker toolkit and that's one of the first things
‫we're going to learn.
‫We're not going to build images or do any advanced stuff until once we've learned what containers are,
‫how to run them, a little bit of how they're different from a VM, and other basic functionality of a container.
‫So the first thing we want to do is make sure that we have the latest version of Docker and it's working.
‫Once we get through that and this lecture, other lectures will talk about how to start containers, how
‫to manage different aspects of a container: start it,
‫stop it,
‫delete it,
‫create it...
‫that sort of stuff.
‫And we're going to use Nginx for all that. Nginx is a really basic web server that is going
‫to be easy for us to use just to learn the Docker commands and how to do Docker container stuff.
‫After that, we're going to jump in some networking basics. You'll learn Docker networking and how the
‫containers talk to each other.
‫And for this whole section, the only real requirement is that you have the latest version of Docker
‫installed and that it's working properly.
‫So in this lecture we're going to make sure real quick that that's set up correctly.
‫In order for the Docker command line to work properly, you need to make sure you're in the proper
‫terminal for your operating system.
‫I'm going to be using Mac, so I can use either Terminal or iTerm2; the two popular choices on the Mac.
‫Then on Windows, if you're on Docker for Windows you'll use PowerShell.
‫If you're on the Docker ToolBox, you'll use the QuickStart Terminal that comes with Docker ToolBox.
‫And if you're on Linux you'll just use a Linux shell of your choosing.
‫These are all things that I talk about in the previous section for your set-up of your own operating
‫system.
‫So if you have more questions just look at those videos.
‫But let's get started.
‫The first command is docker version. This command simply returns the version of your client --
‫that's the CLI that we just used -- and the server, also called the engine; and, the engine is running
‫in the background on your machine.
‫On Windows it's usually called a service on Mac and Linux,
‫ot's usually called a daemon.
‫And what is happening here is our docker command line is actually talking to the server on my machine and
‫then returning its values, as well as the client values themselves.
‫Ideally they should be the same but they don't have to be the same versions.
‫And you want them to be the latest version as possible. If you have an older version like 1.12 or 1.13,
‫you definitely want to make sure that you go to the previous section and get the proper versions installed
‫because we'll be using a lot of new features that are only in the latest versions.
‫The fact that I did get returned information from the server, validates that I can talk to the server
‫and that it's working properly.
‫If you do get an error there, that means maybe you need to do a sudo docker version.
‫If you're maybe on Linux, or possibly your Docker isn't actually running and you maybe need to go to the
‫previous section setup videos to make sure that Docker's running properly.
‫Now let's get a little more information out of our Docker engine.
‫If we do a docker info, it'll return a lot more stuff than just the version. It'll actually give us a
‫lot of details about our configuration and setup for our engine.
‫Some of these are obvious, like the number of containers you have running or possibly the number of images
‫you have stored in Docker.
‫But a lot of this other stuff may not make sense now and that's fine.
‫We're going to go through a lot of it throughout this course.
‫Now you might be wondering what are all the commands you can use in Docker.
‫And you can get a list of those by simply just typing docker and hitting return.
‫You'll see a long list down here at the bottom.
‫This is not actually the full list, because if you notice up here at the top,
‫we now have this management command.
‫So starting in early 2017, Docker realized that we're getting so many commands down here in this list --
‫where I would just type docker space and the command -- that there were so many of them that they needed
‫to create an easier way to organize all these commands.
‫That's when they created the management commands and that creates a format where you have docker
‫space the management command and then the subcommand. So you will see throughout this course that we're
‫trying to use a little bit of both.
‫We mostly will use the new model of Docker.
‫Let's use an example here of container run -- and that's the new format of that command.
‫But since the beginning of the Docker project, docker run has usually been the way that we type that
‫command.
‫It's just recently that the docker container run has become the new way to run that command.
‫Now the cool thing about Docker, is that it's really focused on backwards compatibility.
‫So the docker run will probably work forever; but, new commands that we get are not going to be using
‫this docker command value.
‫It will be using docker space command space subcommand value. So, each time I use these commands,
‫we will explain what they are and I will show you possibly the old way of doing it and the new way of
‫doing it depending on whether the command has that option.
‫So it'll start to make sense as we go through this course.
‫OK even though we had a very short lecture, and it was pretty simple, let's just review real quick those
‫commands.
‫The docker version command is the one I always use first on a new Docker system; just to make sure that
‫my client can talk to the engine and that I'm running the version that I would expect.
‫Secondly docker info gives me a lot of the configuration values out of the engine just to make sure that
‫it's set up that way that I expect.
‫And lastly, we talked about the command line structure. The old way still works.
‫So for older commands that have been around for the last 4+ years, they still work with docker
‫command and then the options.
‫But for new commands going forward, Docker is creating a new model of the management commands with docker
‫space command space subcommand. The example we use was docker run,
‫one of the most common commands you use in Docker where the old way was docker run but the new way of
‫docker container run also works.
‫And you can decide how you want to use those commands whether you want to use the old way or the new
‫way because they both will still work.