CentOS7开发环境

基础配置

修改主机名

1
2
3
4
# 查看一下当前主机名的情况
$ hostnamectl
$ hostnamectl set-hostname gakki --static
$ hostnamectl status

基础工具

1
2
3
4
5
# 解决ifconfig 不存在
$ yum -y install net-tools
# 文件传输
$ yum -y install lrzsz
$ yum install -y unzip zip

docker安装

安装docker

  1. 新建docker_install.sh
  2. 复制官方脚本https://get.docker.com/ 内容
  3. 安装与启动
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## 授权
$ chmod docker_install.sh
## 安装
$ ./chmod docker_install.sh
## 移除脚本
$ rm docker_install.sh
## 启动
$ systemctl start docker.service
## 开机自启动
$ systemctl enable docker.service
  1. 设置代理
1
$ vim /etc/docker/daemon.json
1
2
3
4
5
6
{
  "insecure-registries" : ["docker.server:80"],
  "debug" : true,
  "experimental" : true,
  "registry-mirrors": ["http://hub-mirror.c.163.com"]
}

安装docker-compose

参照官网教程

1
2
$ sudo curl -L "https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose
uyaki 支付宝支付宝
uyaki 微信微信
0%