1.先检查是否安装旧版本docker
[[email protected] ~]# rpm -qa|grep docker
我这里没有安装,如果安装,请rpm -e 卸载
2.编辑docker.repo文件,写入如下内容
[[email protected] ~]# vim /etc/yum.repos.d/docker.repo
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
3.安装docker
[[email protected] ~]# yum install docker-engine
4.启动docker
[[email protected] ~]# systemctl start docker
[[email protected] ~]# docker info #查看
时间: 2024-10-13 10:22:26