代码拉取完成,页面将自动刷新
同步操作将从 java110/HCDoc 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/bash
# +-------------------------------------------------------------------
# | HC-docker一键安装程序
# | Author: 王天良([email protected])
# +--------------------------------------------------------------------
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
install_tmp='/tmp/install.pl'
sys_path="/hcdemo"
Install_Docker_ce()
{
#install docker-ce
#pip install pytz
yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine -y
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum makecache fast
yum -y install docker-ce
#systemctl or service
if [ -f /usr/bin/systemctl ];then
systemctl stop [email protected]
systemctl mask [email protected]
systemctl enable docker
systemctl start docker
else
chkconfig --add docker
chkconfig --level 2345 docker on
service docker start
fi
}
Install_docker()
{
mkdir -p /$sys_path/server/docker
systemctl start docker
is_start=$(systemctl status docker|grep "active (running)")
if [ "$is_start" == "" ];then
rm -f /var/lib/docker
if [ -f "/usr/bin/apt-get" ];then
Install_Ubuntu_ce
elif [ -f "/usr/bin/yum" ];then
Install_Docker_ce
fi
fi
echo '安装完成' > $install_tmp
}
Uninstall_docker()
{
rm -rf /$sys_path/server/docker
# rm -rf /usr/bin/docker
if [ -f "/usr/bin/apt-get" ];then
systemctl stop docker
#pip uninstall docker -y
yum -y remove docker docker-common docker-selinux docker-engine
elif [ -f "/usr/bin/yum" ];then
if [ -f /usr/bin/systemctl ];then
systemctl disable docker
systemctl stop docker
else
service docker stop
chkconfig --level 2345 docker off
chkconfig --del docker
fi
#pip uninstall docker -y
yum -y remove docker docker-common docker-selinux docker-engine
fi
}
action=$1
if [ "${1}" == 'install' ];then
Install_docker
elif [ "${1}" == 'update' ];then
Install_docker
elif [ "${1}" == 'uninstall' ];then
Uninstall_docker
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。