CentOS7用阿里云Docker Yum源在线安装Docker 17.03.2 - 锐意工作室 - CSDN博客

参考文档

安装步骤

删除已安装的Docker

# Uninstall installed docker
sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-selinux \
                  docker-engine-selinux \
                  docker-engine

配置阿里云Docker Yum源

# Set up repository
sudo yum install -y yum-utils device-mapper-persistent-data lvm2

# Use Aliyun Docker
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

安装指定版本

查看Docker版本:

yum list docker-ce --showduplicates

安装较旧版本(比如Docker 17.03.2) 时需要指定完整的rpm包的包名,并且加上--setopt=obsoletes=0 参数:

# Install docker
# on a new system with yum repo defined, forcing older version and ignoring obsoletes introduced by 17.06.0
yum install -y --setopt=obsoletes=0 \
   docker-ce-17.03.2.ce-1.el7.centos.x86_64 \
   docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch

或安装Docker较新版本(比如Docker 18.03.0)时加上rpm包名的版本号部分:

sudo yum install docker-ce-18.03.0.ce

或安装Docker最新版本,无需加版本号:

sudo yum install docker-ce

启动Docker服务

# Start docker service
systemctl enable docker
systemctl start docker
5369  2019-04-15 17:53:10 root yum remove docker                   docker-client                   docker-client-latest                   docker-common                   docker-latest                   docker-latest-logrotate                   docker-logrotate                   docker-engine
 5370  2019-04-15 17:54:45 root yum install -y yum-utils device-mapper-persistent-data lvm2
 5371  2019-04-15 17:55:10 root sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
 5372  2019-04-15 17:55:22 root yum list docker-ce --showduplicates
 5373  2019-04-15 17:56:25 root yum install docker-ce.x86_64                                                                              18.06.3.ce-3.el7
 5374  2019-04-15 17:57:12 root yum install docker-ce.x86_64.18.06.3.ce-3.el7
 5375  2019-04-15 17:57:35 root yum install docker-ce-18.06.3.ce-3.el7
 5376  2019-04-15 17:58:46 root systemctl enable docker
 5377  2019-04-15 17:58:55 root systemctl start docker
 5378  2019-04-15 18:00:10 root docker version

Original url: Access
Created at: 2019-04-15 17:51:45
Category: default
Tags: none

请先后发表评论
  • 最新评论
  • 总共1条评论
DeepMind

Rain酱

Mark 

2019-04-15 18:04:05 回复