代码拉取完成,页面将自动刷新
#!/bin/bash
#author: MonsterTan
#date: 2019-01-15
#this is a script that can install automatically docker software by centos7
function checkSudo (){
if [ $UID -ne 0 ];then
echo -e 'it must be root!'
exit 1
fi
}
checkSudo
## something required system utils
yum install -y yum-utils device-mapper-persistent-data lvm2
## add repo source info
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sudo yum mackecache fast
sudo yum -y install docker-ce
sudo systemctl start docker
str=successed!
if [ $? -eq 0 ];then
echo -e "\033[32msuccessed!\033[0m"
else
echo -e "\033[31msomething wrong, please check!\033[0m"
fi
echo -e "\033[31mstart to install docker-compose\033[0m"
result=`ls /usr/bin/ | grep ^pip$`
if [ ${#result} -eq 0 ];then
echo -e "\033[31mpip must be necessary, it should be installed firstly\033[0m"
fi
sudo pip install docker-compose
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。