Centos7初始化加docker安装

限于喜欢 提交于 2020-08-18 00:15:31

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

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!