CentOS7安装docker以及错误解决;centos7安装PMM监控

两种安装方法:
1.离线安装
2.yum安装

先介绍yum安装方法
1.移除旧版本:
yum remove docker docker-common container-selinux docker-selinux docker-engine docker-ce-cli docker-ce
2.安装系统必要工具
yum install -y yum-utils device-mapper-persistent-data lvm2
3.添加国内阿里云yum源
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
4.更新yum缓存
yum makecache fast
5.安装docker-ce
列出可以用版本
yum list docker-ce.x86_64 --showduplicates |sort -r
yum install docker-ce.x86_64

安装过程中出现dependences依赖要求container-selinux>2.XX问题
Error: Package: 3:docker-ce-19.03.5-3.el7.x86_64 (docker-ce-stable)
Requires: container-selinux >= 2:2.74
Error: Package: containerd.io-1.2.10-3.2.el7.x86_64 (docker-ce-stable)
Requires: container-selinux >= 2:2.74
原因还是国内yum源软件包不全
需要手动去下载:https://pkgs.org/download/container-selinux
选择对用版本

离线安装
准备好rpm安装包
container-selinux-2.107-3.el7.noarch.rpm
containerd.io-1.2.0-3.el7.x86_64.rpm
docker-ce-cli-18.09.0-3.el7.x86_64.rpm
docker-ce-18.09.0-3.el7.x86_64.rpm
安装有先后顺序:安装上面顺序依次安装
rpm -ivh *

注意:docker-ce-18.09.0-3.el7.x86_64.rpm中带3的版本
下载的container-selinux-2.107-3.el7.noarch.rpm也要选择带3的版本
不然提示还是依赖出错
Error: Package: 3:docker-ce-19.03.5-3.el7.x86_64 (docker-ce-stable)
Requires: container-selinux >= 2:2.74
Error: Package: containerd.io-1.2.10-3.2.el7.x86_64 (docker-ce-stable)
Requires: container-selinux >= 2:2.74
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

启动docker
systemctl enable docker && systemctl start docker

ps -ef | grep docker

root 11325 1 0 12:06 ? 00:00:03 /usr/bin/dockerd -H unix://
root 11335 11325 0 12:06 ? 00:00:06 containerd --config /var/run/docker/containerd/containerd.toml --log-level info
root 16040 25317 0 12:43 pts/0 00:00:00 grep --color=auto docker

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值