1.配置yum源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.cloud.tencent.com/repo/epel-7.repo
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum clean all
yum makecache
2.安装依赖包
yum install -y yum-utils device-mapper-persistent-data lvm2
3.安装docker
yum install -y docker-ce docker-ce-cli containerd.io
4.开启docker服务
systemctl start docker
5.验证docker运行情况
*在本地没有相应名称镜像的情况下,会自动向docker hub拉取
docker run hello-world
6.配置docker镜像加速器
curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://f1361db2.m.daocloud.io
网友评论