增加配置项是否启用docker仓库镜像

pull/641/head
gjmzj 2019-07-15 00:08:22 +08:00
parent 7317a080d7
commit 6ec6e94dea
2 changed files with 12 additions and 8 deletions

View File

@ -10,3 +10,9 @@ STORAGE_DIR: "/var/lib/docker"
# 开启Restful API
ENABLE_REMOTE_API: false
# 启用 docker 仓库镜像
ENABLE_MIRROR_REGISTRY: true
# 设置 docker 仓库镜像
REG_MIRRORS: '["https://dockerhub.azk8s.cn", "https://docker.mirrors.ustc.edu.cn"]'

View File

@ -1,9 +1,10 @@
{
"registry-mirrors": [
"https://dockerhub.azk8s.cn",
"https://docker.mirrors.ustc.edu.cn",
"http://hub-mirror.c.163.com"
],
{% if ENABLE_MIRROR_REGISTRY %}
"registry-mirrors": {{ REG_MIRRORS }},
{% endif %}
{% if ENABLE_REMOTE_API %}
"hosts": ["tcp://0.0.0.0:2376", "unix:///var/run/docker.sock"],
{% endif %}
"max-concurrent-downloads": 10,
"log-driver": "{{ LOG_DRIVER }}",
"log-level": "{{ LOG_LEVEL }}",
@ -12,7 +13,4 @@
"max-file": "{{ LOG_MAX_FILE }}"
},
"data-root": "{{ STORAGE_DIR }}"
{% if ENABLE_REMOTE_API %}
, "hosts": ["tcp://0.0.0.0:2376", "unix:///var/run/docker.sock"]
{% endif %}
}