操作系统版本 AlmaLinux 9.3
- 安装
dnf-utils
1sudo dnf install -y dnf-utils
- 添加 Docker CE 存储库
1sudo dnf config-manager --add-repo https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/docker-ce.repo
1yum-config-manager --add-repo https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/docker-ce.repo
添加过后,执行列出 Alma Linux上可用存储库的列表
1sudo dnf repolist
- 把软件仓库地址替换为镜像站
1sed -i 's+https://download.docker.com+https://mirrors.tuna.tsinghua.edu.cn/docker-ce+' /etc/yum.repos.d/docker-ce.repo
- 安装 Docker CE
1sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
- 启动并启用 Docker
1sudo systemctl start docker
2sudo systemctl enable docker
- 配置国内镜像源
1{
2 "registry-mirrors": [
3 "https://docker.1panel.live"
4 ]
5}
1sudo systemctl daemon-reload
2sudo systemctl restart docker