1、环境初始化配置:
yum install -y vim net-tools bind-utils lrzsz wget sysstat iotop iftop nc
setenforce 0
sed -i 's#^SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
getenforce
systemctl disable firewalld
systemctl stop firewalld
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache
yum -y install gcc
yum -y install gcc-c++
2、docker 安装:
yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-selinux \ docker-engine-selinux \ docker-engine
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum makecache fast
yum -y install docker-ce
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{ "registry-mirrors": ["https://nkhaeg5s.mirror.aliyuncs.com"] }
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
service docker start
systemctl enable docker
3、关闭swap分区
https://my.oschina.net/dtz/blog/4503287
来源:oschina
链接:https://my.oschina.net/dtz/blog/4503289