shell脚本部署docker和docker-compose-创新互联

shell脚本部署docker和docker-compose

创新互联基于成都重庆香港及美国等地区分布式IDC机房数据中心构建的电信大带宽,联通大带宽,移动大带宽,多线BGP大带宽租用,是为众多客户提供专业电信机房托管报价,主机托管价格性价比高,为金融证券行业服务器托管,ai人工智能服务器托管提供bgp线路100M独享,G口带宽及机柜租用的专业成都idc公司。
#!/bin/bash

#Date: 2010-06-24
#Author: Bob
#Description: deploy docker&&docker-compose

if [[ "$(whoami)" != "root" ]]; then
    echo "Please run this script as root ." >&2
    exit 1
fi

echo -e "\033[31m Start installing docker&&docker-compose.Please continue to enter or ctrl+C to cancel \033[0m"

install_dependence(){
    yum -y install epel-release
}

install_docker(){
    yum -y install docker
    systemctl start docker.service
    docker -v
    echo "docker installed successfully."
}

install_docker_compose(){
    curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" > /usr/local/bin/docker-compose
    chmod +x /usr/local/bin/docker-compose
    docker-compose --version
    echo "docker-compose installed successfully."
}

main(){
    install_dependence
    install_docker
    install_docker_compose
}

main > /root/docker.log 2>&1

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


网站标题:shell脚本部署docker和docker-compose-创新互联
URL分享:http://pwwzsj.com/article/gedji.html