美文网首页
CentOS7 安装 Docker 简易步骤

CentOS7 安装 Docker 简易步骤

作者: 聆世冷暖 | 来源:发表于2019-08-09 10:37 被阅读0次

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

相关文章

网友评论

      本文标题:CentOS7 安装 Docker 简易步骤

      本文链接:https://www.haomeiwen.com/subject/luscjctx.html