服务器环境的配置
新购买的服务器的环境配置
修改主机名
[root@VM-0-16-centos ~]# hostnamectl set-hostname jimyag
[root@VM-0-16-centos ~]# vim /etc/hosts
127.0.0.1 jimyag
127.0.0.1 localhost.localdomain localhost
127.0.0.1 localhost4.localdomain4 localhost4
::1 jimyag jimyag
::1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
[root@VM-0-16-centos ~]# reboot
更新源
yum update
安装docker
yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sudo yum makecache fast
yum install -y docker-ce
systemctl start docker.service
systemctl enable docker.service
curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.4/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
go环境安装
在Linux安装Go环境 | 步履不停 (jimyag.cn)
git配置.配置一个用于提交代码的用户,输入指令
git config –global user.name “Your Name” 同时配置一个用户的邮箱,输入命令:
git config --global user.email "[email protected]"
生成公钥和私钥(用于github)
ssh-keygen -t rsa -C "[email protected]"