CentOS 8 安装docker

安装依赖

 yum install -y yum-utils  device-mapper-persistent-data  lvm2
 #添加阿里云镜像源
 yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo 
 
yum install docker-ce docker-ce-cli containerd.io
 
如果报错:Problem: package docker-ce-3:19.03.4-3.el7.x86_64 requires containerd.io >= 1.2.2-3 那就先装新版的 containerd.io
CentOS 8 安装docker
dnf install http://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm
 
再装剩下两个
sudo yum install docker-ce docker-ce-cli
 
sudo systemctl start docker
 
docker --version
 
开机自启
sudo systemctl enable docker

相关推荐