1.参考文档
https://docs.docker.com/engine/reference/commandline/dockerd/#options
2.基础环境 (服务器IP:172.17.0.51,52,53)
a.系统版本 CentOS Linux release 7.6.1810 (Core)
b.docker版本 Docker version 18.06.3-ce, build d7080c1
c.修改主机名 hostnamectl --static set-hostname node51,修改 /etc/hosts
2.安装docker
a. 添加docker yum 源
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
b. 查看版本列表
yum list docker-ce --showduplicates | sort -r
c. 安装docker
yum install -y docker-ce-18.06.3.ce-3.el7
3.配置docker
a.日志及仓库配置
mkdir /etc/docker
cat << EOF > /etc/docker/daemon.json
{
"insecure-registries": ["172.17.0.52:5000"],
"log-driver": "json-file",
"log-opts": {
"max-size": "500m",
"max-file": "4"
}
}
EOF
b.启动参数配置
EnvironmentFile=/run/flannel/subnet.env
ExecStart=/usr/bin/dockerd $DOCKER_NETWORK_OPTIONS
4.启动配置
systemctl enable docker && systemctl daemon-reload && systemctl start docker