1. 卸载 podman

yum -y erase podman buildah

2. 安装依赖包

yum install -y yum-utils device-mapper-persistent-data lvm2

3. 配置镜像源

yum config-manager --add-repo=https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

4. Docker安装

(1) 安装 containerd

yum install -y containerd.io --allowerasing

(2) 安装 Docker Engine-Community

手动安装Docker安装详细教程-LMLPHP

yum install -y docker-ce-3:24.0.6-1.el9

手动安装Docker安装详细教程-LMLPHP

systemctl enable docker
systemctl start docker

5. 配置镜像加速器

镜像文件一般都很大,如果觉得镜像下载比较慢可配置镜像加速器。

阿里云镜像加速器获取地址: https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors

直接完整复制以下命令执行:

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://xxxx.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
10-10 20:00