Skip to content

Instantly share code, notes, and snippets.

@curder
Last active June 3, 2020 09:17
Show Gist options
  • Save curder/59c53f85d281e4fb7293c0e3f0c7f9e8 to your computer and use it in GitHub Desktop.
Save curder/59c53f85d281e4fb7293c0e3f0c7f9e8 to your computer and use it in GitHub Desktop.

Revisions

  1. curder revised this gist Jun 3, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion centos-go-docker-centos8.sh
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    #!/bin/bash

    # 更新yum
    sudo yum update
    sudo yum update -y

    # 更新依赖
    sudo yum install -y git tree bash-completion telnet
  2. curder revised this gist Jun 3, 2020. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion centos-go-docker-centos8.sh
    Original file line number Diff line number Diff line change
    @@ -37,4 +37,4 @@ alias gp='git push'
    alias nah='git reset --hard;git clean -df'
    EOL

    sudo source /etc/profile && sudo tail -n10 /etc/profile
    source /etc/profile && sudo tail -n10 /etc/profile
    2 changes: 1 addition & 1 deletion centos-go-docker.sh
    Original file line number Diff line number Diff line change
    @@ -31,4 +31,4 @@ alias gp='git push'
    alias nah='git reset --hard;git clean -df'
    EOL

    sudo source /etc/profile && sudo tail -n10 /etc/profile
    source /etc/profile && sudo tail -n10 /etc/profile
  3. curder revised this gist Jun 3, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion centos-go-docker-centos8.sh
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ sudo yum install -y git tree bash-completion telnet
    sudo dnf install -y https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm
    sudo yum install -y yum-utils device-mapper-persistent-data lvm2
    sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
    sudo yum install docker-ce
    sudo yum install -y docker-ce
    sudo systemctl start docker && sudo systemctl enable docker # 启动docker
    sudo usermod -aG docker $USER

  4. curder revised this gist Jun 3, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion centos-go-docker-centos8.sh
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ sudo yum update
    sudo yum install -y git tree bash-completion telnet

    # 安装Docker依赖环境
    sudo dnf install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm
    sudo dnf install -y https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm
    sudo yum install -y yum-utils device-mapper-persistent-data lvm2
    sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
    sudo yum install docker-ce
  5. curder revised this gist Jun 3, 2020. 2 changed files with 49 additions and 9 deletions.
    40 changes: 40 additions & 0 deletions centos-go-docker-centos8.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,40 @@
    #!/bin/bash

    # 更新yum
    sudo yum update

    # 更新依赖
    sudo yum install -y git tree bash-completion telnet

    # 安装Docker依赖环境
    sudo dnf install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm
    sudo yum install -y yum-utils device-mapper-persistent-data lvm2
    sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
    sudo yum install docker-ce
    sudo systemctl start docker && sudo systemctl enable docker # 启动docker
    sudo usermod -aG docker $USER

    # 安装docker-compose
    sudo curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.5/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose

    # 安装GO
    sudo wget https://dl.google.com/go/go1.14.3.linux-amd64.tar.gz && mkdir -p /usr/local/go && tar xf go1.14.3.linux-amd64.tar.gz && mv go/* /usr/local/go/.
    sudo rm -rf go*
    sudo cat >> /etc/profile <<'EOL'
    # go env config
    export GO11MODULE=on
    export GOROOT=/usr/local/go
    export GOPATH=$HOME
    export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
    EOL

    # git别名
    sudo cat >> /etc/profile <<'EOL'
    # git alias
    alias gst="git status"
    alias gl="git pull"
    alias gp='git push'
    alias nah='git reset --hard;git clean -df'
    EOL

    sudo source /etc/profile && sudo tail -n10 /etc/profile
    18 changes: 9 additions & 9 deletions centos-go-docker.sh
    Original file line number Diff line number Diff line change
    @@ -1,20 +1,20 @@
    #!/bin/bash

    # 更新依赖
    yum install -y git tree bash-completion telnet
    sudo yum install -y git tree bash-completion telnet

    # 一键安装docker
    curl -sSL https://get.daocloud.io/docker | sh
    systemctl start docker && systemctl enable docker # 启动docker
    sudo curl -sSL https://get.daocloud.io/docker | sh
    sudo systemctl start docker && sudo systemctl enable docker # 启动docker
    sudo usermod -aG docker $USER

    # 安装docker-compose
    curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.5/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose
    sudo curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.5/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose

    # 安装GO
    wget https://dl.google.com/go/go1.14.3.linux-amd64.tar.gz && mkdir -p /usr/local/go && tar xf go1.14.3.linux-amd64.tar.gz && mv go/* /usr/local/go/.
    rm -rf go*
    cat >> /etc/profile <<'EOL'
    sudo wget https://dl.google.com/go/go1.14.3.linux-amd64.tar.gz && mkdir -p /usr/local/go && tar xf go1.14.3.linux-amd64.tar.gz && mv go/* /usr/local/go/.
    sudo rm -rf go*
    sudo cat >> /etc/profile <<'EOL'
    # go env config
    export GO11MODULE=on
    export GOROOT=/usr/local/go
    @@ -23,12 +23,12 @@ export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
    EOL

    # git别名
    cat >> /etc/profile <<'EOL'
    sudo cat >> /etc/profile <<'EOL'
    # git alias
    alias gst="git status"
    alias gl="git pull"
    alias gp='git push'
    alias nah='git reset --hard;git clean -df'
    EOL

    source /etc/profile && tail -n10 /etc/profile
    sudo source /etc/profile && sudo tail -n10 /etc/profile
  6. curder created this gist Jun 3, 2020.
    34 changes: 34 additions & 0 deletions centos-go-docker.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,34 @@
    #!/bin/bash

    # 更新依赖
    yum install -y git tree bash-completion telnet

    # 一键安装docker
    curl -sSL https://get.daocloud.io/docker | sh
    systemctl start docker && systemctl enable docker # 启动docker
    sudo usermod -aG docker $USER

    # 安装docker-compose
    curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.5/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose

    # 安装GO
    wget https://dl.google.com/go/go1.14.3.linux-amd64.tar.gz && mkdir -p /usr/local/go && tar xf go1.14.3.linux-amd64.tar.gz && mv go/* /usr/local/go/.
    rm -rf go*
    cat >> /etc/profile <<'EOL'
    # go env config
    export GO11MODULE=on
    export GOROOT=/usr/local/go
    export GOPATH=$HOME
    export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
    EOL

    # git别名
    cat >> /etc/profile <<'EOL'
    # git alias
    alias gst="git status"
    alias gl="git pull"
    alias gp='git push'
    alias nah='git reset --hard;git clean -df'
    EOL

    source /etc/profile && tail -n10 /etc/profile