Docker uses domestic mirror library method

After installing docker, if you use docker to download the image directly, the speed is very slow, and it will even break

Use the accelerator by modifying or creating the daemon configuration file /etc/docker/daemon.json


1. Official mirror in China:

vi /etc/docker/daemon.json

Add the following content to the file (create if there is no such file):

{

     "registry-mirrors":["https://registry.docker-cn.com"]

}

 

2. Other domestic mirrors:

NetEase
http://hub-mirror.c.163.com

USTC 
https://docker.mirrors.ustc.edu.cn

University of Science and Technology of China
https://docker.mirrors.ustc.edu.cn

Alibaba Cloud Container Service
https://cr.console.aliyun.com/
homepage and click "Create My Container Image" to get a dedicated image acceleration address, similar to "https://1234abcd.mirror.aliyuncs.com"

3. Restart docker:

3.1 One instruction restart:

systemctl restart docker

 

3.2 Two instructions to restart:

$ sudo systemctl daemon-reload
$ sudo systemctl restart docker

Guess you like

Origin blog.csdn.net/qq_37488998/article/details/111871113