在Centos8上运行上述命令的话,会报错
Error: Problem: package docker-ce-3:19.03.12-3.el7.x86_64 requires containerd.io >= 1.2.2-3, but none of the providers can be installed
…
(try to add ‘–skip-broken’ to skip uninstallable packages or ‘–nobest’ to use not only best candidate packages)
解决方法:
点击连接下载最新版本containerd
根据实际情况选择,我这里是在鲲鹏云上,所以选择了aarch64版本
yum -y install https://download.docker.com/linux/centos/7/aarch64/stable/Packages/containerd.io-1.2.6-3.3.el7.aarch64.rpm
安装指定版本 yum list docker-ce --showduplicates | sort -r yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io 启动docker systemctl start docker 验证安装结果 docker run hello-world出现如下结果表明安装成功
# docker run hello-world # 或者 # docker container run hello-world Hello from Docker! This message shows that your installation appears to be working correctly. ...... 卸载docker yum remove docker-ce docker-ce-cli containerd.io # 移除所有镜像,容器,卷积 rm -rf /var/lib/docker docker常用命令 # 列出本机的所有 image 文件。 $ docker image ls # 删除 image 文件 $ docker image rm [imageName] #终止容器服务 docker container kill [containerID] #或者 docker kill [containerID] #列出本机正在运行的容器 docker ps #或者 docker container ls #列出本机所有容器 docker ps -all