This is the 4th day of my participation in the August More Text Challenge

There is no road in vain. Every step counts

Docker installation

Docker engine basically supports all mainstream operating systems, including Windows, MacOS, Linux, Unix, but in fact, xiaobian personal do not recommend using Windows system to install Docker, Windows installation please refer to the Windows download website.

The following describes how to install the Docker engine in Linux. However, the docker engine must be installed on centos7.x or later. The docker engine cannot be installed on centos earlier than 7. For details about installation methods, refer to official documents and strictly execute commands.

Here xiaobian introduces a general installation method, whether in Linux or Unix-like system can be installed, in the test or development environment Docker official in order to simplify the installation process, provides a set of convenient installation script, centos system can use this script to install, You can also use a domestic source installation with the –mirror option. After the command is executed, the script automatically prepares everything and installs a stable version of Docker on the system.

# installation docker
    curl -fsSL get.docker.com -o get-docer.sh   Download the script file
    sudo sh get-docer.sh --mirror Aliyun   

# Docker service status
	systemctl status docker
Start the Docker service
	systemctl start docker
Check that docker is successfully started and can view the docker version
	docker info
Configure docker to start automatically after startup
	systemctl enable docker
Create a docker group and use root
     sudo groupadd docker
     sudo usermod -aG docker $USER
Restart the Docker service
	systemctl restart docker
Copy the code

Docker core concepts

Docker belongs to CS architecture, and various Docker commands we run belong to client behavior. In order to conveniently start learning Docker, important concepts in Docker must be understood. Here are some important but not difficult concepts like Kangkang.

Docker engine is running a container, container can be regarded as a running software environment, such as MySQL container, Redis container, etc., where does the container come from? Simply speaking, a mirror represents a software, such as MySQL image, Redis image, etc., but not with a mirror, mirror in particular is similar to the software installation package, installation package to run to install successfully, so the characteristics of the mirror is read-only.

Container: An instance started based on an image is called a container or a service. An image can produce N containers, which are readable and writable.

Reponsitory: The location where all docker images are stored (official and your own).

Remote repository: Docker maintains a unique remote repository in the world, such as dockerHub local repository: the current download image storage location in their own machine, only save their own used images and their own custom images.Copy the code

The image we need can go to the Docker remote repository to pull down, so how to determine whether the image and the image version we need exist in the remote repository? Docker officially provides dockerHub, the web interface of the remote warehouse. You can search for the image and version you need in this page. It should be noted that the officle logo in the image represents the official image.

You can intuitively see the relationship among the three through the following figure:

Docker download image acceleration

When you go to the remote warehouse to pull the mirror, because it will be very slow to download directly through dockerhub for many times, so in order to pull faster, Ali bigshot made a nationwide mirror warehouse in China, the mirror warehouse will copy the remote mirror warehouse all over, Docker image acceleration can be set to improve the speed of pulling images. Perform the following steps to configure mirror acceleration:

① After the installation of Docker, you need to go to ali Cloud official website to register ali Cloud account (you can use alipay account to log in).

② Login account.

③ Go to the administrative console.

④ Search for container image services in product services.

⑤ Click the Mirror tool to find the mirror accelerator.

⑥ Copy the command.

⑦ Restart the docker(systemctl restart docker).

conclusion

The article was first published in the wechat public account Program Yuan Xiaozhuang, at the same time in nuggets.

The code word is not easy, reprint please explain the source, pass by the little friends of the lovely little finger point like and then go (╹▽╹)