!/bin/bash
CentOS7.9装机脚本
需要联网,并以root身份运行
SSH KEY
ssh-keygen
禁用防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
设置github的hosts
tee -a /etc/hosts <<-'EOF'
140.82.113.3 github.com
185.199.108.133 raw.githubusercontent.com
EOF
更新常用命令包
yum -y update
yum -y install vim
yum -y install sshpass
yum -y install screen
安装git
yum -y install http://opensource.wandisco.com/centos/7/git/x86_64/wandisco-git-release-7-2.noarch.rpm
yum -y install git
git config --global user.name "yuri2"
git config --global user.email "[email protected]"
安装nodejs(其实更推荐用nvm)
curl -fsSL https://rpm.nodesource.com/setup_16.x | bash -
yum install -y nodejs
安装常用nodejs库
npm i pm2 -g
pm2 startup
npm i gtop -g
npm i fs-extra -g
安装docker
curl -sSL https://get.daocloud.io/docker | sh
curl -L https://get.daocloud.io/docker/compose/releases/download/v2.14.0/docker-compose-uname -s
-uname -m
> /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://f1361db2.m.daocloud.io
systemctl enable docker
systemctl start docker
nvm安装nodejs
1. curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
2. nvm install node # "node" is an alias for the latest version
3. node -v 测试安装是否成功.
echo "完成。"
标签:脚本,git,centos,yum,install,装机,docker,com,nvm From: https://www.cnblogs.com/gdluck/p/17128009.html