1.关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
2.关闭SeLinux
setenforce 0
3.安装
sudo yum -y install yum-utils vim
sudo yum-config-manager --add-repo [http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo](http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo)
sudo yum install -y device-mapper-persistent-data lvm2
sudo yum cleal all
sudo yum -y install docker-ce
4.修改源加快拉取镜像
mkdir /etc/docker/
vim /etc/docker/daemon.json
{
"registry-mirrors": ["https://vp4xwrbd.mirror.aliyuncs.com"],
"insecure-registries": ["0.0.0.0/0"]
}
{
"registry-mirrors": ["https://e3uz0rrs.mirror.aliyuncs.com"]
}
5.开启远程访问
vim /lib/systemd/system/docker.service
修改
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H [unix://var/run/docker.sock](unix://var/run/docker.sock)
6.重启应用
systemctl daemon-reload
service docker restart
systemctl start docker
systemctl enable docker
网友评论