本次操作系统为Centos7.9,下载地址为

百度网盘:https://pan.baidu.com/s/15SjhTCPExWuaHWadaGjJJA?pwd=y9iy 

配置阿里云yum软件源

# mkdir /etc/yum.repos.d/repo-bak
# mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/repo-bak/
# curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
# yum clean all
# yum makecache

docker安装,需要内核3.10以上,建议在安装docker之前,先更新软件包

# yum update -y

下载docker安装源

yum install -y yum-utils
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
# yum makecache fast

如果下载的是docker官方的源,则需要修改下镜像地址为国内的,否则下载docker安装文件会很慢
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sed -i 's+download.docker.com+mirrors.aliyun.com/docker-ce+' /etc/yum.repos.d/docker-ce.repo

安装docker

# yum install -y docker-ce

启动docker

# systemctl start docker
# systemctl status docker
# systemctl enable docker

ym设置镜像加速

# tee /etc/docker/daemon.json <<-'EOF'
{
 "registry-mirrors": ["https://docker.1panel.live",
"https://hub.rat.dev",
"https://docker.actima.top",
"https://atomhub.openatom.cn",
"https://docker.m.daocloud.io",
"https://docker.nastool.de",
"https://dockerpull.org",
"https://registry.dockermirror.com",
"https://docker.m.daocloud.io",
"https://docker.1ms.run",
"https://docker.aityp.com",
"https://dockerhub.xisoul.cn",
"https://docker.imgdb.de",
"https://hub.littlediary.cn",
"https://docker.unsee.tech",
"https://hub.crdz.gq",
"https://hub.firefly.store",
"https://docker.kejilion.pro",
"https://dhub.kubesre.xyz",
"https://hub.xdark.top",
"https://docker.udayun.com" 
]
}
EOF

重启Docker

# systemctl daemon-reload 
# systemctl restart docker

 

拉取镜像测试

# docker pull mysql
或
# docker pull mysql:5.7

 

声明:欢迎大家光临本站,学习IT运维技术,转载本站内容,请注明内容出处”来源刘国华教育“。如若本站内容侵犯了原著者的合法权益,请联系我们进行处理。