From cb133cba68440de7124fdc5d58674419e8779c04 Mon Sep 17 00:00:00 2001
From: rongzhang <rongzhang@alauda.io>
Date: Sun, 9 Sep 2018 01:20:48 +0800
Subject: [PATCH] Add registry_mirrors config to docker options

---
 inventory/sample/group_vars/all/docker.yml | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/inventory/sample/group_vars/all/docker.yml b/inventory/sample/group_vars/all/docker.yml
index cea860c36..b32b55253 100644
--- a/inventory/sample/group_vars/all/docker.yml
+++ b/inventory/sample/group_vars/all/docker.yml
@@ -25,6 +25,11 @@ docker_bin_dir: "/usr/bin"
 #   - mirror.registry.io
 #   - 172.19.16.11
 
+## Add other registry,example China registry mirror.
+#registry_mirrors:
+#   - https://registry.docker-cn.com
+#   - https://mirror.aliyuncs.com
+
 ## If non-empty will override default system MounFlags value.
 ## This option takes a mount propagation flag: shared, slave
 ## or private, which control whether mounts in the file system
@@ -38,6 +43,9 @@ docker_options: >-
   {%- if insecure_registries is defined -%}
   {{ insecure_registries | map('regex_replace', '^(.*)$', '--insecure-registry=\1' ) | list | join(' ') }}
   {%- endif %}
+  {% if registry_mirrors is defined -%}
+  {{ registry_mirrors | map('regex_replace', '^(.*)$', '--registry-mirror=\1' ) | list | join(' ') }}
+  {%- endif %}
   --graph={{ docker_daemon_graph }} {{ docker_log_opts }}
   {%- if ansible_architecture == "aarch64" and ansible_os_family == "RedHat" %}
   --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current
-- 
GitLab