docker安装
1.配置yum源
cd /etc/yum.repos.d
wget http://mirrors.aliyun.com/repo/Centos-7.repo
wget https://download.docker.com/linux/centos/docker-ce.repo
2.添加内核参数
vim /etc/sysctl.conf
添加内容:
net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.all.rp_filter = 0
重新加载sysctl.conf
sysctl -p
3.关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
4.安装docker服务
yum -y install docker-io
启动docker
systemctl start docker
关闭docker
systemctl stop docker
重启docker
systemctl restart docker
设置开机自启
systemctl enable docker
设置开机不自启
systemctl disable docker
5.显示docker系统信息
docker info