Skip to content

Commit

Permalink
增加docker 配置文件
Browse files Browse the repository at this point in the history
  • Loading branch information
gjmzj committed Aug 12, 2018
1 parent 4cd887f commit f2a75c6
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 11 deletions.
11 changes: 11 additions & 0 deletions roles/docker/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# 国内镜像加速

REG_MIRROR_1: "https://registry.docker-cn.com"
REG_MIRROR_2: "https://docker.mirrors.ustc.edu.cn"

# docker日志相关

LOG_DRIVER: "json-file"
LOG_LEVEL: "warn"
LOG_MAX_SIZE: "10m"
LOG_MAX_FILE: 3
10 changes: 0 additions & 10 deletions roles/docker/files/daemon.json

This file was deleted.

2 changes: 1 addition & 1 deletion roles/docker/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
copy: src=docker dest=/etc/bash_completion.d/docker mode=0644

- name: docker国内镜像加速
copy: src=daemon.json dest=/etc/docker/daemon.json
template: src=daemon.json.j2 dest=/etc/docker/daemon.json

- name: flush-iptables
shell: "iptables -F && iptables -X \
Expand Down
10 changes: 10 additions & 0 deletions roles/docker/templates/daemon.json.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"registry-mirrors": ["{{ REG_MIRROR_1 }}", "{{ REG_MIRROR_2 }}"],
"max-concurrent-downloads": 10,
"log-driver": "{{ LOG_DRIVER }}",
"log-level": "{{ LOG_LEVEL }}",
"log-opts": {
"max-size": "{{ LOG_MAX_SIZE }}",
"max-file": "{{ LOG_MAX_FILE }}"
}
}
2 changes: 2 additions & 0 deletions tools/init_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- cluster-addon
- cluster-restore
- cluster-storage
- docker
- flannel
- helm
- kube-node
Expand All @@ -28,6 +29,7 @@
- cluster-addon
- cluster-restore
- cluster-storage
- docker
- flannel
- helm
- kube-node
Expand Down

0 comments on commit f2a75c6

Please sign in to comment.