1 Star 0 Fork 2

tutuwin/12306

forked from xcland/12306 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
docker_install_centos.sh 961 Bytes
一键复制 编辑 原始数据 按行查看 历史
tan 提交于 2019-01-15 16:36 . add docker install script
#!/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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tutuwin/12306.git
git@gitee.com:tutuwin/12306.git
tutuwin
12306
12306
master

搜索帮助