zoukankan      html  css  js  c++  java
  • Centos7安装Docker脚本

    #!/bin/bash
    #
    #********************************************************************
    #Author:            Wuvikr
    #QQ:                744123155
    #Date:              2020-12-01
    #FileName           docker_install_for_centos7.sh
    #URL:               http://www.wuvikr.top
    #Description        The test script
    #Copyright (C):     2020 All rights reserved
    #********************************************************************
    PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
    export PATH
    
    Version="19.03.13-3.el7"
    
    # 下载docker安装源
    wget -P /etc/yum.repos.d/ https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
    
    # 安装docker
    yum -y install docker-ce-$Version docker-ce-cli-$Version || echo -e '33[1;31m安装失败,请检查网络和yum源配置!33[0m'
    
    # 使用国内镜像加速
    # 阿里云(需要登录账号分配地址)
    # 网易云 https://vgunv6qp.mirror.aliyuncs.com
    # 腾讯云 https://mirror.ccs.tencentyun.com
    # 中科大 https://docker.mirrors.ustc.edu.cn
    # docker中国 https://registry.docker-cn.com
    mkdir -p /etc/docker
    tee /etc/docker/daemon.json <<-'EOF'
    {
        "registry-mirrors": [
            "https://mirror.ccs.tencentyun.com",
            "https://docker.mirrors.ustc.edu.cn",
            "https://registry.docker-cn.com"
        ]
    }
    EOF
    
    # 重新加载配置并启动docker
    systemctl daemon-reload
    systemctl enable --now docker
    
    docker version && echo -e "33[1;32m${Version}安装成功!33[0m" || echo -e '33[1;31m安装失败!33[0m'
    
    
  • 相关阅读:
    Python—模块
    Python之路_Day5
    Python之路_Day4
    Py获取本机指定网卡的ip地址
    Python之路_Day3
    Python之路—Day2作业
    Python之路—Day2
    Python之路—Day1作业
    Python之路—Day1
    Python数据类型
  • 原文地址:https://www.cnblogs.com/wuvikr/p/14067137.html
Copyright © 2011-2022 走看看