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
相关推荐
码农101号38 分钟前
Linux中Docker Compose介绍和使用
linux·运维·docker
IT成长日记2 小时前
【Docker基础】Dockerfile多阶段构建:Multi-stage Builds详解
运维·docker·容器·multi-stage·builds
deeper_wind5 小时前
keeplived双击热备配置
linux·运维·网络
GoldKey7 小时前
gcc 源码阅读---语法树
linux·前端·windows
BUTCHER58 小时前
Docker镜像使用
java·docker·容器
小趴菜吖8 小时前
使用macvlan实现容器的跨主机通信
docker
无敌糖果8 小时前
K8S的Helm包管理器
docker·容器·kubernetes·helm·helm安装包
筱小虾米8 小时前
Docker配置国内镜像源
运维·docker·容器
黎茗Dawn9 小时前
连接new服务器注意事项
linux·python
L_autinue_Star9 小时前
从0到1实现Shell!Linux进程程序替换详解
linux·运维·服务器·c++·chrome