CentOS7版本下
升级包
yum -y update
卸载原有包
yum remove docker-selinux -y
这里为什么只卸载docker-selinux呢?
因为卸载docker-selinux的时候会自动把docker相关的依赖都卸载掉
依赖关系解决
==========================================================================================================================================================================
Package 架构 版本 源 大小
==========================================================================================================================================================================
正在删除:
container-selinux noarch 2:2.119.2-1.911c772.el7_8 @extras 41 k
为依赖而移除:
containerd.io x86_64 1.6.21-3.1.el7 @docker-ce-stable 114 M
docker-ce x86_64 3:24.0.2-1.el7 @docker-ce-stable 98 M
docker-ce-rootless-extras x86_64 24.0.2-1.el7 @docker-ce-stable 19 M
事务概要
==========================================================================================================================================================================
移除 1 软件包 (+3 依赖软件包)
安装大小:231 M
是否继续?[y/N]:y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在删除 : docker-ce-rootless-extras-24.0.2-1.el7.x86_64 1/4
正在删除 : 3:docker-ce-24.0.2-1.el7.x86_64 2/4
正在删除 : containerd.io-1.6.21-3.1.el7.x86_64 3/4
正在删除 : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch 4/4
验证中 : 3:docker-ce-24.0.2-1.el7.x86_64 1/4
验证中 : containerd.io-1.6.21-3.1.el7.x86_64 2/4
验证中 : docker-ce-rootless-extras-24.0.2-1.el7.x86_64 3/4
验证中 : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch 4/4
删除:
container-selinux.noarch 2:2.119.2-1.911c772.el7_8
作为依赖被删除:
containerd.io.x86_64 0:1.6.21-3.1.el7 docker-ce.x86_64 3:24.0.2-1.el7 docker-ce-rootless-extras.x86_64 0:24.0.2-1.el7
完毕!
重新安装docker-ce
如果之前没有安装docker安装源的话,还需要安装一下
yum-config-manager --add-repo https://mirrors.ustc.edu.cn/docker-ce/linux/centos/docker-ce.repo
yum makecache fast
安装
#安装docker
yum install docker-ce -y
#设置开机自启
systemctl enable docker
#启动docker
systemctl start docker
如果之前没设置相关配置
#配置加速
cat <<EOF > /etc/docker/daemon.json
{
"registry-mirrors": [
"https://docker.mirrors.ustc.edu.cn",
"https://hub-mirror.c.163.com",
"https://reg-mirror.qiniu.com",
"https://registry.docker-cn.com"
],
"exec-opts": ["native.cgroupdriver=systemd"],
"data-root": "/data/docker",
"log-driver": "json-file",
"log-opts": {
"max-size": "200m",
"max-file": "5"
}
}
EOF
#重启docker
systemctl restart docker
值得注意的是: docker的很多加速地址都没法使用了,镜像无法正常拉取,所以上述配置只是例子,使用时一定要删掉加速地址,添加上自己的加速地址,加速地址可以在云服务商处获取,这里就不作详细阐述了
标签:x86,24.0,ce,升级,64,版本,docker,el7 From: https://www.cnblogs.com/guangdelw/p/17519003.html