summaryrefslogtreecommitdiff
path: root/data/templates/container/registries.conf.j2
blob: b5c7eed9b3f3672a15a965e498f9158c00085754 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
### Autogenerated by container.py ###

# For more information on this configuration file, see containers-registries.conf(5).
#
# NOTE: RISK OF USING UNQUALIFIED IMAGE NAMES
# We recommend always using fully qualified image names including the registry
# server (full dns name), namespace, image name, and tag
# (e.g., registry.redhat.io/ubi8/ubi:latest). Pulling by digest (i.e.,
# quay.io/repository/name@digest) further eliminates the ambiguity of tags.
# When using short names, there is always an inherent risk that the image being
# pulled could be spoofed. For example, a user wants to pull an image named
# `foobar` from a registry and expects it to come from myregistry.com. If
# myregistry.com is not first in the search list, an attacker could place a
# different `foobar` image at a registry earlier in the search list. The user
# would accidentally pull and run the attacker's image and code rather than the
# intended content. We recommend only adding registries which are completely
# trusted (i.e., registries which don't allow unknown or anonymous users to
# create accounts with arbitrary names). This will prevent an image from being
# spoofed, squatted or otherwise made insecure.  If it is necessary to use one
# of these registries, it should be added at the end of the list.
#
# An array of host[:port] registries to try when pulling an unqualified image, in order.
# unqualified-search-registries = ["example.com"]

{% if registry is vyos_defined %}
{%     set registry_list = [] %}
{%     for r, r_options in registry.items() if r_options.disable is not vyos_defined %}
{%         set _ = registry_list.append(r) %}
{%     endfor %}
unqualified-search-registries = {{ registry_list }}
{%     for r, r_options in registry.items() if r_options.disable is not vyos_defined %}
[[registry]]
{%         if r_options.mirror is vyos_defined %}
location = "{{ r_options.mirror.host_name if r_options.mirror.host_name is vyos_defined else r_options.mirror.address }}{{ ":" + r_options.mirror.port if r_options.mirror.port is vyos_defined }}{{ r_options.mirror.path if r_options.mirror.path is vyos_defined }}"
{%         else %}
location = "{{ r }}"
{%         endif %}
insecure = {{ 'true' if r_options.insecure is vyos_defined else 'false' }}
prefix = "{{ r }}"
{%     endfor %}
{% endif %}