【cockpit】CentOS7.x上cockpit的离线安装包制作
在使用yum安装cockpit时,是分模块安装的,也就是说,如果只是执行了yum install cockpit,那么最终提供的功能就是你所看到的最基本的功能,此时如果还需要添加类似“容器”选项,需执行yum install cockpit-docker,除此之外还有许多模块,可以一次性安装yum install cockpit-* 。安装完所需的模块之后,再进入web监控页面,则可以看到已经添加了相应的模块了。
CentOS7.x 上,如果你的docker是二进制安装,你要小心了,安装docker插件时,会认为你没有装dockrer.默认会安装epel源中docker版本,导致已安装的docker被覆盖,如果你的高版本docker版本身就是基于rpm安装,没问题!
我们了解到cockpit-docker的rpm安装依赖于docker,那么如果我们是二进制安装的docker的前提下,可以选择强制安装cockpit-docker,不会有问题!
# yum -y install epel-release
# mkdir yum
# repotrack cockpit cockpit-dashboard cockpit-doc dockpit-docker -p cockpitDeps
# rm -f yum/docker-*
# createrepo -v yum
# tar -zcf yum.tar.gz yum
# cat install_cockpit.sh
#######################################
#!/bin/bash
parent_path="$( cd "$(dirname "$0")"; pwd -P )"
cd "$parent_path"
rm -rf /tmp/yum
tar -zxf yum.tar.gz -C /tmp
echo "
[YUM]
name=yum
baseurl=file:///tmp/yum
enable=1
gpgcheck=0 " > /etc/yum.repos.d/yum.repo
yum clean all
yum -y install cockpit cockpit-dashboard cockpit-doc --disablerepo="*" --enablerepo="YUM"
rpm -ivh /tmp/yum/cockpit-docker-*.rpm --force --nodeps
systemctl start cockpit
systemctl enable cockpit.socket
systemctl status cockpit
rm -rf /tmp/yum
#########################################