依赖工具安装
sudo yum install -y yum-utils
修改镜像 https://mirrors.aliyun.com
yum源配置 /etc/yum.repos.d/
sudo yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
1.安装docker——用yum安装
sudo yum install docker-ce docker-ce-cli containerd.io
sudo systemctl enable docker
sudo systemctl start docker
创建或修改 /etc/docker/daemon.json 文件,修改:
{
"registry-mirrors" : [
"https://mirrors.tuna.tsinghua.edu.cn",
"http://hub-mirror.c.163.com",
"https://docker.mirrors.ustc.edu.cn",
"https://cr.console.aliyun.com",
"https://mirror.ccs.tencentyun.com"
]
}
重启docker服务使配置生效:
systemctl daemon-reload
systemctl restart docker.service