1.创建文件夹

sudo mkdir -p /etc/docker

2.编辑/etc/docker/daemon.json文件,并输入国内镜像源地址

Docker Proxy(国内已被河蟹):

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

阿里云容器镜像服务:

https://cr.console.aliyun.com/

 sudo vim /etc/docker/daemon.json
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
   "registry-mirrors": [
        "https://yanyu.icu",
        "https://dc.j8.work",
        "https://docker.m.daocloud.io",
        "https://dockerproxy.com",
        "https://dockerhub.timeweb.cloud"
    ]
}
EOF

3.重启Docker服务

sudo systemctl daemon-reload
sudo systemctl restart docker

4.配置完成检查

docker info

9520d9caaadf412f88129745c0b472a1.png