CentOS Linux Yum Docker安装与升级

官网安装:https://docs.docker.com/engine/install/centos/#install-using-the-repository

卸载旧版

powershell 复制代码
# 停止docker
systemctl stop docker
# 卸载docker
yum remove docker \
	docker-client \
	docker-client-latest \
	docker-common \
	docker-latest \
	docker-latest-logrotate \
	docker-logrotate \
	docker-engine
或
yum remove docker*
  • yum可能会报告您没有安装这些包。
  • /var/lib/docker/卸载 Docker 时,存储的图像、容器、卷和网络不会被自动删除

查看可用版本

powershell 复制代码
yum list docker-ce --showduplicates | sort -r

docker-ce.x86_64    3:26.1.3-1.el9    docker-ce-stable
docker-ce.x86_64    3:26.1.2-1.el9    docker-ce-stable

官网版本说明个人没看明白,此处个人的理解:
3:26.1.3-1.el9 冒号前面3代表docker-ce 和 docker-ce-cli 用于区分不同的包,26.1.3-1.el9 是实际版本。

安装Docker

bash 复制代码
yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io docker-buildx-plugin docker-compose-plugin
# 个人没有安装:docker-buildx-plugin docker-compose-plugin
yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io
# 示例
yum install docker-ce-26.1.2-1.el9 docker-ce-cli-26.1.2-1.el9 containerd.io

启动

bash 复制代码
systemctl start docker
相关推荐
susu10830189111 小时前
Debian 11 Bullseye 在线安装docker
运维·docker·debian
行止61 小时前
OpenStack云平台管理
linux·openstack
love530love2 小时前
Docker 稳定运行与存储优化全攻略(含可视化指南)
运维·人工智能·windows·docker·容器
岁岁岁平安2 小时前
CentOS-7-x86_64解决:使用NAT模式无法ping通www.baidu.com或无法ping 8.8.8.8问题。
linux·运维·centos·centos-7
运维小贺2 小时前
各服务器厂商调整BIOS睿频教程
linux·运维·服务器·性能优化
人生匆匆2 小时前
docker进入启动失败的容器
运维·docker·容器
特种加菲猫2 小时前
指尖上的魔法:优雅高效的Linux命令手册
linux·笔记
★Orange★3 小时前
Linux Kernel kfifo 实现和巧妙设计
linux·运维·算法
bemyrunningdog3 小时前
Mock数据
linux·运维·ubuntu
是阿建吖!3 小时前
【Linux | 网络】网络编程套接字
linux·网络