环境:
OS:Centos 7
步骤1:
[root@localhost yum.repos.d]# yum install -y yum-utils device-mapper-persistent-data lvm2 Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was 14: curl#7 - "Failed to connect to 2a05:d012:8b5:6503:9efb:5cad:348f:e826: Network is unreachable"
报错误:
解决办法:
mv CentOS-Base.repo CentOS-Base.repobak
步骤2:
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
步骤3:
yum list docker-ce --showduplicates | sort -r
步骤4:
yum install -y docker-ce
报如此错误:
Error: Package: containerd.io-1.6.33-3.1.el7.x86_64 (docker-ce-stable) Requires: container-selinux >= 2:2.74 Error: Package: docker-ce-rootless-extras-26.1.4-1.el7.x86_64 (docker-ce-stable) Requires: slirp4netns >= 0.4 Error: Package: 3:docker-ce-26.1.4-1.el7.x86_64 (docker-ce-stable) Requires: container-selinux >= 2:2.74 Error: Package: docker-ce-rootless-extras-26.1.4-1.el7.x86_64 (docker-ce-stable) Requires: fuse-overlayfs >= 0.7
解决办法:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum install epel-release -y
yum install container-selinux -y #安装最新的contain-selinux
再次安装
yum install -y docker-ce
步骤5:
启动
systemctl start docker
systemctl status docker
步骤6:
查看版本
docker version
docker -v
标签:centos,64,ce,repo,yum,install,镜像,docker From: https://www.cnblogs.com/hxlasky/p/18343441