docker安装(CentOS8)
2020-07-18 05:28
411 查看
Centos8 安装docker
使用yum安装docker-ce:
命令:# 1. 更新yum包到最新 yum update # 2. 安装yum-utils(提供 yum-config-manager 功能)、同时需要安装两个devicemapper驱动依赖 yum install -y yum-utils device-mapper-persistent-data lvm2 # 3. 设置yum源:https://download.docker.com/linux/centos/docker-ce.repo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo # 4. 安装docker yum install -y docker-ce # 可用yum list查看docker-ce的版本,安装指定版本只需要指定安装docker-ce-版本号即可 yum list docker-ce --showduplicates | sort -r # 5. 验证安装 docker -v
第三步:yum会在/etc/yum.repos.d/下去找默认配置文件,然后在网上搜索
踩坑:
1.第四步安装docker
yum install -y docker-ce Updating Subscription Management repositories. Unable to read consumer identity This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Docker CE Stable - x86_64 11 kB/s | 20 kB 00:01 error: problem: package docker-ce-3:19.03.4-3.el7.x86_64 requires containerd.io >= 1.2.2-3, but none of the providers can be installed - cannot install the best candidate for the job - package containerd.io-1.2.10-3.2.el7.x86_64 is excluded - package containerd.io-1.2.2-3.3.el7.x86_64 is excluded - package containerd.io-1.2.2-3.el7.x86_64 is excluded - package containerd.io-1.2.4-3.1.el7.x86_64 is excluded - package containerd.io-1.2.5-3.1.el7.x86_64 is excluded - package containerd.io-1.2.6-3.3.el7.x86_64 is excluded (try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
这是因为安装 docker-ce-3:19.03.4-3.el7.x86_64的需要containerd.io版本>=1.2.2-3,当前系统的containerd.io版本不够。
解决方法有三种:1.安装更低版本的docker,是你系统的containerd.io版本支持的:
# 反序打印docker-ce的 yum list docker-ce --showduplicates | sort -r
# 安装指定版本 yum -y install docker-ce-18.06.0.ce-3.el7
2.安装命令后面追加 --skip-broken(跳过此项安装) 或者 --nobest (使用最佳安装包) 进行安装:
yum install -y docker-ce --nobest # 或者 dnf -y install docker-ce --nobest
3.更新containerd.io,再安装docker
yum list containerd.io --showduplicates | sort -r
# 可以看到这里containerd.io并没有支持的版本(>1.2.2-3),所以选择从外部直接下载安装包:网址是https://download.docker.com/linux/centos/7/x86_64/stable/Packages/ # - 下载的方法有两种:使用win下载再使用工具传入linux系统(比如xshell的xFTP) # - 使用wget download_url 指令直接使用下载链接在linux下载目标文件
#下载的安装包是.rpm文件,使用rpm安装前要先卸载原containerd.io再安装 rpm -e containerd.io rpm -ivh containerd.io-1.2.4-3.1.el7.x86_64.rpm
如果安装时遇到
worning:containerd.io-1.2.4-3.1.el7.x86_64.rpm: 头V4 RSA/SHA512 Signature, 密钥 ID 621e9f35: NOKEY
错误:依赖检测失败:
runc 与 containerd.io-1.2.4-3.1.el7.x86_64 冲突
runc 被 containerd.io-1.2.4-3.1.el7.x86_64 取代
# 删除runc及其依赖后重装即可 yum erase runc (erase等价与remove) rpm -ivh containerd.io-1.2.4-3.1.el7.x86_64.rpm # 然后安装docker-ce: yum install -y docker-ce
相关文章推荐
- Centos8 docker 安装tensorflow 和jupyter notebook
- Centos8 安装 docker的一些命令
- centos8 安装docker
- CentOS8安装docker-CE版本之镜像加速
- centos8安装docker环境
- Centos8下安装Docker
- centos7安装docker
- Docker 安装 zabbix4.2
- 通过Docker Machine快速安装Docker环境
- docker 安装
- DockerToolBox for win10安装
- docker 及 docker-compose 的快速安装和简单使用
- 【Caffe】【场景分类】Places365安装、docker运行,以及调用本地caffe运行(Ubuntu14.04)
- CentOS 7.2安装Docker-ce
- Docker Toolbox - 安装ubuntu操作系统
- docker安装mysql
- Docker 在REHL(REHL、CENTOS、FEDORA等)的安装
- docker安装eclipse che
- Docker的安装(基于Unbuntu16.04)
- 【Docker】将RancherOS安装到硬盘