1. Docker Basics

Docker is an open-sourse container. It is developed to ease the deplyment process. For instance, if your project requires you to install python, c++, cmake, etc, you need to install the required dependencies, softwares, libraries one by one. If another developer/customer/user would like to reproduce your work, they also need to configure the environment as you. However, such process may be difficult.

  1. There may be a huge amount of dependencies. If you have worked with a relatively big project, you may have noticed that configuring the environment can take hours to even days.

  2. The required operating system may be different from your host machine.

1.1. The difference between Docker and Virtual Machine

Yes, whatever docker can do can be done by a virtual machine, but whatever a virtual machine can do could not be done by docker. Docker can be viewed as a tiny operating system that only contains the kernal and file system. You can install softwares, libraries, configure system settings, but you may not have a GUI. You can think of docker as a light-weighted virtual machine at present. As you explore more, you will notice the differences.

1.2. Install Docker

The docker installation guide can be found Docker Desktop overview .

1.3. Basic Concept

(The following description is based on my understanding. If you want a formal explanation, please visit the offical webpage.)

Image : Something like a “Class” in an objective oriented language. It’s not a runnable instance, but a template with defined installation guide.

Container : Something like an “object” or “instance” in an objective oriented language. An instance configured based on the intruction of the corresponding Image.

Repository : Similar to the Github Repository, a storage for docker images.

Host : A virtual or physical machine that runs the docker container.