{
  "data-root": "{{ docker_data }}",
  "exec-opts": ["native.cgroupdriver={{ docker_cgroups_driver|default('systemd') }}"],
  "storage-driver": "{{ docker_storage_driver|default('overlay2') }}",
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "100m"
  },
  "metrics-addr" : "{{ inventory_hostname }}:{{ docker_exporter_port }}",
  "experimental" : true,
  "registry-mirrors" : {{ docker_registry_mirrors|default([]) | to_json }},
{% if proxy_env is defined and proxy_env is mapping %}
  "proxies": {
{% if 'http_proxy' in proxy_env %}
    "http-proxy": "{{ proxy_env['http_proxy'] }}",
{% elif 'all_proxy' in proxy_env %}
    "http-proxy": "{{ proxy_env['all_proxy'] }}",
{% endif %}
{% if 'https_proxy' in proxy_env %}
    "https-proxy": "{{ proxy_env['https_proxy'] }}",
{% elif 'all_proxy' in proxy_env %}
    "https-proxy": "{{ proxy_env['all_proxy'] }}",
{% endif %}
{% if 'no_proxy' in proxy_env %}
    "no-proxy": "{{ proxy_env['no_proxy'] }}"
{% else %}
    "no-proxy": "localhost,127.0.0.1,10.0.0.0/8,192.168.0.0/16,*.pigsty"
{% endif %}
  },
{% endif %}
  "default-ulimits": {
    "nofile": { "Hard": 1048576, "Soft": 1048576, "Name": "nofile" }
  },
  "max-concurrent-downloads": 8
}
