1.先检查是否安装旧版本docker
[[email protected] ~]# rpm -qa|grep docker [[email protected] ~]# 我这里没有安装,如果安装,请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] ~]# ps -ef|grep docker root 3361 1 0 11:22 ? 00:00:00 /usr/bin/docker daemon -H fd:// root 3478 3116 0 11:22 pts/1 00:00:00 grep --color=auto d
时间: 2024-10-05 09:46:45