1.系统要求
centos 7 以上
2.环境要求
# 关闭防火墙systemctl stop firewalld
systemctl disable firewalld
3.docker 安装
wget https://yum.dockerproject.org/repo/main/centos/7/Packages/docker-engine-1.13.1-1.el7.centos.x86_64.rpm
yum -y localinstall docker-engine-1.13.1-1.el7.centos.x86_64.rpm
4.配置 docker 参数
cat > /etc/docker/daemon.json <<EOF
{
"storage-driver": "overlay",
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"]
}
EOF
5.启动 2376 监听端口
docker 是 C/S 模式的,默认只监听本地-H unix:///var/run/docker.sock,若要远程监听修改/usr/lib/systemd/system/dockerer.service 文件。把 ExecStart 这一行改成如下:
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2376 -H unix:///var/run/docker.sock
5.启动 docker
systemctl start docker
systemctl enable docker