1、卸载旧docker
sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
2、安装所需的软件包
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
3、设置稳定的仓库
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
4、安装docker
sudo yum install docker-ce docker-ce-cli containerd.io
5、设置开机启动
systemctl enable docker
网友评论