解决 docker pull 拉取镜像因版本问题导致的拉取失败
在Centos7中,yum源存在着旧版本的docker,我们需要对其升级,以确保正常使用。
卸载旧版本的docker
Bash
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
安装仓库添加工具
Bash
yum install -y yum-utils
为Docker设置仓库
Bash
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
安装 Docker Engine
Bash
yum install -y docker-ce docker-ce-cli containerd.io
启动
Bash
systemctl start docker
检查版本
Bash
[root@hk7 ~]# docker version
Client: Docker Engine - Community
Version: 25.0.3
API version: 1.44
Go version: go1.21.6
Git commit: 4debf41
Built: Tue Feb 6 21:17:10 2024
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 25.0.3
API version: 1.44 (minimum version 1.24)
Go version: go1.21.6
Git commit: f417435
Built: Tue Feb 6 21:16:08 2024
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.28
GitCommit: ae07eda36dd25f8a1b98dfbf587313b99c0190bb
runc:
Version: 1.1.12
GitCommit: v1.1.12-0-g51d5e94
docker-init:
Version: 0.19.0
GitCommit: de40ad0
发表评论