Docker 版本升级

1、查看系统要求

Docker 要求 CentOS 系统的内核版本高于 3.10 ,查看CentOS的内核版本。

uname -a
uname -a
uname -a

2、删除旧版本

yum remove docker docker-common docker-selinux docker-engine
yum remove docker docker-common docker-selinux docker-engine
yum remove docker docker-common docker-selinux docker-engine

3、安装需要的软件包

yum-util 提供yum-config-manager功能,另外两个是devicemapper驱动依赖的

sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum install -y yum-utils device-mapper-persistent-data lvm2

4、设置Docker yum源

sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

5、查看所有仓库中所有docker版本

可以查看所有仓库中所有docker版本,并选择特定的版本安装。

yum list docker-ce --showduplicates | sort -r
yum list docker-ce --showduplicates | sort -r
yum list docker-ce --showduplicates | sort -r

6、安装docker

sudo yum install docker-ce
sudo yum install docker-ce
sudo yum install docker-ce

由于repo中默认只开启stable仓库,故这里安装的是最新稳18.03.0.ce-1.el7.centos。

如果要安装特定版本:

sudo yum install docker-ce-18.06.1.ce
sudo yum install docker-ce-18.06.1.ce
sudo yum install docker-ce-18.06.1.ce

7、启动

设置为开机启动

systemctl enable docker
systemctl enable docker
systemctl enable docker
systemctl start docker
systemctl start docker
systemctl start docker

查看启动状态

systemctl status docker
systemctl status docker
systemctl status docker

查看版本

docker version
docker version
docker version

原文链接:https://blog.csdn.net/qq_15371293/article/details/126285024?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522171836840916800211531517%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=171836840916800211531517&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~times_rank-13-126285024-null-null.nonecase&utm_term=docker%E3%80%81%E5%A5%BD%E7%94%A8

© 版权声明
THE END
喜欢就支持一下吧
点赞15 分享