docker安装固定版本20.10 k8s 1.23.17兼容版本

Ubuntu 2204(apt)

先卸载旧版本:

c 复制代码
apt remove -y docker docker-engine docker.io containerd runc

安装依赖:

c 复制代码
apt update
apt install -y ca-certificates curl gnupg lsb-release

导入官方 GPG key:

c 复制代码
mkdir -p /etc/apt/keyrings
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

添加官方仓库:

c 复制代码
echo  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

更新索引:

c 复制代码
apt update

查看可安装的 20.10 版本:

c 复制代码
apt-cache madison docker-ce

安装(示例):

c 复制代码
apt install -y \
  docker-ce=5:20.10.24~3-0~ubuntu-$(lsb_release -cs) \
  docker-ce-cli=5:20.10.24~3-0~ubuntu-$(lsb_release -cs) \
  containerd.io

启动:

c 复制代码
systemctl enable docker
systemctl restart docker
docker version

CentOS / Rocky / Alma(yum)

删除旧版本:

c 复制代码
yum remove -y docker \
  docker-client \
  docker-client-latest \
  docker-common \
  docker-latest \
  docker-latest-logrotate \
  docker-logrotate \
  docker-engine

安装工具:

c 复制代码
yum install -y yum-utils

添加官方仓库:

c 复制代码
yum-config-manager \
  --add-repo \
  https://download.docker.com/linux/centos/docker-ce.repo

查看 20.10:

c 复制代码
yum list docker-ce --showduplicates | grep 20.10

安装:

c 复制代码
yum install -y \
  docker-ce-20.10.24 \
  docker-ce-cli-20.10.24 \
  containerd.io

启动:

c 复制代码
systemctl enable docker
systemctl restart docker
docker version

二进制文件下载链接

c 复制代码
https://download.docker.com/linux/static/stable/

https://download.docker.com/linux/static/stable/x86_64/docker-20.10.24.tgz

官方脚本

c 复制代码
curl -fsSL https://get.docker.com -o get-docker.sh && sudo sh get-docker.sh

GPG 添加命令

c 复制代码
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg	

Ubuntu 所有版本安装命令速查表

c 复制代码
下表汇总了 Ubuntu 各主要版本的 Docker 20.10.x 安装命令,需要将 VERSION_STRING 替换为要安装的具体版号(如 5:20.10.24~3-0~ubuntu-jammy):

版本代号	Ubuntu 版本号		软件源添加命令
Jammy	22.04 (LTS)  echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu jammy stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null	sudo apt-get update 

Focal	20.04 (LTS)	 echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu focal stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null	

Bionic	18.04 (LTS)	 echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu bionic stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null	

Xenial	16.04 (LTS)	 echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu xenial stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

安装命令

c 复制代码
sudo apt-get install docker-ce=$VERSION_STRING docker-ce-cli=$VERSION_STRING containerd.io docker-buildx-plugin docker-compose-plugin
相关推荐
青 春 记 忆8 小时前
Dify Docker Compose 通用无损升级指南:从备份、双版本预演到切换与回滚
运维·人工智能·python·docker·容器
Java王小怪9 小时前
Docker环境Redis没挂载保存数据
运维·docker·容器
AKCJDJ11 小时前
k8s的管理及控制器管理
云原生·容器·kubernetes
灰阳阳11 小时前
Docker-数据卷命令解析
java·docker·eureka
SCandL15211 小时前
k8s service
linux·容器·kubernetes
zhangfeng113312 小时前
AMD Instinct MI50(gfx906)上为 Qwen 系列模型优化并可用的 vLLM 相关仓库、Docker 镜像与实践指南。
人工智能·docker·ai编程·qwen·算子开发·vllm·mi50
众人皆醒我独醉13 小时前
InferenceGraph:把多个推理服务编排成 DAG
面试·kubernetes·gpu
众人皆醒我独醉13 小时前
LLMService:KServe 面向 LLM 的下一步
面试·kubernetes·gpu
aaaBsBsBsB13 小时前
k8s pod管理
运维·docker·容器
Doep_key15 小时前
Kubenetes控制器
运维·docker·容器