Centos安装docker显示No package docker-ce available. No package docker-ce-cli available. No package containerd.io.available.
1. 卸载老版本的 docker 及其相关依赖
yum remove docker docker-common container-selinux docker-selinux docker-engine
2,更新yum
yum update
3. 安装 yum-utils,它提供了 yum-config-manager,可用来管理yum源
yum install -y yum-utils
4. 添加yum源
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
5. 更新记录
#centos7
yum makecache fast
#centos8
yum makecache
6. 安装 docker-ce
centos8 需要先安装依赖包,centos7可直接跳过下面两步直接安装docker-ce
(1) 获取rpm
wget https://download.docker.com/linux/centos/7/x86_64/edge/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm
(2)安装rpm
yum -y install containerd.io-1.2.6-3.3.el7.x86_64.rpm
(3)安装docker-ce
yum install -y docker-ce
7. 启动 docker
systemctl start docker
8. 验证是否安装成功
docker info
9.安装docker-compose
(1) 安装epel源
yum install -y epel-release
(2 )安装docker-compose
yum install -y docker-compose
评论