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
相关推荐
Learn-Share_HY8 分钟前
[Linux]如何設置靜態IP位址?
linux·运维·tcp/ip·ubuntu·static ip
明月与玄武34 分钟前
Jenkins+Docker+Git实现自动化CI/CD
git·docker·jenkins·ci/cd流水线
Everbrilliant891 小时前
Ubuntu系统下交叉编译Android的X265库
linux·运维·ubuntu·x265交叉编译·android x265·ffmpeg x265
我不要放纵1 小时前
LVS集群搭建
linux·服务器·lvs
阿巴~阿巴~1 小时前
自主Shell命令行解释器
linux·运维·服务器
许白掰1 小时前
Linux入门篇学习——借助 U 盘或 TF 卡拷贝程序到开发板上
linux·学习·借助 u 盘拷贝程序到开发板上·借助 tf卡拷贝程序到开发板上
小周学学学1 小时前
docker安装与简单项目上手
运维·docker·容器
小刘|2 小时前
腾讯云服务上下载docker以及使用Rabbitmq的流程
docker·rabbitmq·腾讯云
云途行者2 小时前
使用 docker 安装 openldap
运维·docker·容器
YuTaoShao3 小时前
【LeetCode 热题 100】994. 腐烂的橘子——BFS
java·linux·算法·leetcode·宽度优先