删除旧版本
            
            
              shell
              
              
            
          
          yum remove docker  docker-common docker-selinux docker-engine安装须要的软件包
            
            
              shell
              
              
            
          
          yum install -y yum-utils device-mapper-persistent-data lvm2设置Docker yum源
            
            
              shell
              
              
            
          
          yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo查看全部仓库中全部docker版本
能够查看全部仓库中全部docker版本,并选择特定的版本安装。
            
            
              shell
              
              
            
          
          yum list docker-ce --showduplicates | sort -r安装docker
            
            
              shell
              
              
            
          
          #因为repo中默认只开启stable仓库,故这里安装的是最新稳定版25.0.3-1.el7
yum install docker-ce
#若是要安装特定版本:
yum install docker-ce-25.0.3-1.el7启动
设置为开机启动
            
            
              shell
              
              
            
          
          systemctl enable docker启动
            
            
              shell
              
              
            
          
          systemctl start docker查看启动状态
            
            
              shell
              
              
            
          
          systemctl status docker查看版本
            
            
              shell
              
              
            
          
          docker version