【docker学习】Docker镜像加速,设置国内源
1.在 /etc/docker/daemon.json 中写入如下内容(默认没有该文件)
vim /etc/docker/daemon.json
2.写入下面内容,并保存退出
{
"registry-mirrors": [
"https://docker.mirrors.ustc.edu.cn/",
"https://hub-mirror.c.163.com",
"https://registry.docker-cn.com",
"https://dockerhub.azk8s.cn",
"https://reg-mirror.qiniu.com",
"https://registry.docker-cn.com"
]
}
3.重启docker生效
sudo systemctl daemon-reload
sudo systemctl restart docker
4.使用docker info验证
5.docker启动报错
解决方案:
systemctl daemon-reload
sudo systemctl restart docker
6.安装docker报错
6.1.No Presto metadata available for docker-ce-stable
yum install docker-ce -y
6.2.Public key for docker-ce-19.03.6-3.el7.x86_64.rpm is not installed
wget https://get.docker.com/gpg
rpmkeys --import ./gpg
6.3.Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
yum provides '*/applydeltarpm'
yum install deltarpm -y