DOCKER - 6 Commands and Setup

Hello everyone and welcome to this introductory course to Docker. What we are going to talk about in this section are containers. Containers are the fundamental building blocks of the Docker toolkit and it's one of the first things we we will learn. We're not going to build images or do advanced stuff until we learn what containers are, how to run them, a bit about how they are different from a virtual machine, and other basic features of a container. So the first thing to do is to make sure we have the latest version of Docker and that it works. After we are done with this course, future courses will explain how to start containers, how to manage different aspects of a container: start it, stop it, delete it, create some... that kind of stuff. And we're going to use Nginx for all of that. Nginx is a basic web server that we will be able to use easily to learn Docker commands and know how to use the functions of Docker containers. After that, we'll move on to some networking basics. You will learn to network Docker and understand how containers communicate with each other. We will very quickly make sure that everything is configured correctly. The first command is Docker version. This command simply returns the version of your client and the server, also called the engine; it runs in the background on your machine. On Windows it is usually called a service, on Mac and Linux it is a daemon. And what's happening here is that our docker command line communicates with the server of my machine, then returns its values, as well as those of the client. Ideally they should be the same, but they don't have to be the same versions. The fact that I received the information returned by the server confirms that I can talk to the server and that it works correctly.
If you get an error, that means maybe you need to do sudo docker version. Now, let's get some more information from our Docker engine. If we do a docker info it will return a lot more stuff than the version. In fact, it will give us a lot of details about our engine configuration. Some of them are obvious, like the number of containers you have running or possibly the number of images that you have stored in Docker. But a lot of that other stuff may not make sense right now and that's okay. We are going to go through a lot 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 just by typing docker and hitting enter. You will see a long list. This isn't actually the complete list, because if you notice here at the top, we now have this management command. So, during the beginning of 2017, Docker realized that we had so many commands in this list, that they were so numerous that they I had to create an easier way to organize all these commands. That's when they created the manage commands, which creates a format where you have Docker, space, the manage command and then the subcommand. So you'll see throughout this course that we'll try to use a bit of both. Let's review very these commands quickly.
The docker version command is the one always used first on a new Docker system; just to make sure the client can communicate with the engine and that I'm using the version I wanted. Second, Docker info gives me a lot of engine configuration values, just to make sure that the configuration is what I expect. Finally, we talked about the structure of the command line. The old method still works. So for older commands that have been around for more than 4 years, they still work with Docker, the command, then the options. But for new commands, Docker creates a new management commands template with docker command space subcommand space.
You can decide how you want to use these commands, whether you want to use the old or the new method, as they will still work.
That's all for this video, but see you soon for the next one.