blob: 8eff0b1813e4aa7cccf57ddec5b781457d966a2b (
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
|
{% raw %}
{% extends parent_template %}
{% block base_header %}
{% endraw %}
ENV PIP_INDEX_URL {{ nodepool_pypi_mirror }}
ENV PIP_TRUSTED_HOST {{ nodepool_mirror_host }}
ENV PIP_EXTRA_INDEX_URL {{ nodepool_wheel_mirror }}
RUN echo registry={{ nodepool_npmjs_proxy }} > /etc/npmrc \
&& mkdir -p /usr/etc \
&& ln -s /etc/npmrc /usr/etc/npmrc
{% raw %}
{% endblock %}
{% block base_centos_repo_overrides_post_copy %}
{% endraw %}
RUN sed -i \
-e "s|^\(mirrorlist.*\)|#\1|" \
-e "s|^#baseurl=http://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|" \
/etc/yum.repos.d/CentOS-*.repo
{% raw %}
{% if distro_package_manager == 'yum' %}
{% endraw %}
# FIXME(mgoddard): No crmsh or opendaylight CentOS 8 repos yet.
RUN sed -i \
-e "s|http://download.opensuse.org|http://{{ nodepool_mirror_host }}/opensuse|" \
/etc/yum.repos.d/crmsh.repo \
&& sed -i \
-e "s|https://cbs.centos.org/repos|{{ nodepool_cbs_centos_proxy }}|g" \
/etc/yum.repos.d/opendaylight.repo
{% raw %}
{% endif %}
{% endraw %}
{% raw %}
{% endblock %}
{% block base_centos_repo_overrides_post_rpm %}
{% endraw %}
{% raw %}
{% endblock %}
{% endraw %}
{% set epel_host_path = 'download.example/pub' if ansible_pkg_mgr == 'dnf' else 'download.fedoraproject.org/pub' %}
{% raw %}
{% block base_centos_repo_overrides_post_yum %}
{% endraw %}
&& sed -i \
-e "s|^\(mirrorlist.*\)|#\1|" \
-e "s|^#baseurl=http://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|" \
-e "s|^#baseurl=https://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|" \
-e "s|^baseurl=http://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|" \
-e "s|^baseurl=https://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|" \
/etc/yum.repos.d/CentOS-*.repo \
&& sed -i \
-e "s|^\(metalink.*\)|#\1|" \
-e "s|^#baseurl=http://{{ epel_host_path }}|baseurl=http://{{ nodepool_mirror_host }}|" \
-e "s|^#baseurl=https://{{ epel_host_path }}|baseurl=http://{{ nodepool_mirror_host }}|" \
/etc/yum.repos.d/epel*.repo \
{% raw %}
{% endblock %}
{% block base_debian_after_sources_list %}
{% if base_distro == "debian" %}
{% endraw %}
RUN sed -i -e "s|http://deb.debian.org|[trusted=yes] http://{{ nodepool_mirror_host }}|" \
-e "s|http://security.debian.org|[trusted=yes] http://{{ nodepool_mirror_host }}|" \
/etc/apt/sources.list
{% raw %}
{% elif base_distro == "ubuntu" %}
{% endraw %}
RUN sed -i -e "s|mirror://mirrors.ubuntu.com/mirrors.txt|[trusted=yes] http://{{ nodepool_mirror_host }}/ubuntu/|" \
-e "s|http://ubuntu-cloud.archive.canonical.com/ubuntu|[trusted=yes] http://{{ nodepool_mirror_host }}/ubuntu-cloud-archive|" \
-e "s|http://ports.ubuntu.com|[trusted=yes] http://{{ nodepool_mirror_host }}/ubuntu-ports|" \
/etc/apt/sources.list
{% raw %}
{% endif %}
{% endblock %}
{# Revert to upstream mirrors after build is complete #}
{% block footer %}
{% endraw %}
ENV PIP_INDEX_URL=
ENV PIP_TRUSTED_HOST=
{% if use_infra_wheels_mirror | default(true) %}
ENV PIP_EXTRA_INDEX_URL=
{% endif %}
RUN if [ -f /usr/etc/npmrc ]; then \
unlink /usr/etc/npmrc; \
fi \
&& rm -f /etc/npmrc
{% raw %}
{% if base_package_type == 'rpm' %}
{% endraw %}
RUN sed -i \
-e "s|^#\(mirrorlist.*\)|\1|" \
-e "s|^baseurl=http://{{ nodepool_mirror_host }}|#baseurl=http://mirror.centos.org|" \
/etc/yum.repos.d/CentOS-*.repo \
&& sed -i \
-e "s|^#\(metalink.*\)|\1|" \
-e "s|^baseurl=http://{{ nodepool_mirror_host }}|#baseurl=http://{{ epel_host_path }}|" \
/etc/yum.repos.d/epel*.repo
{% raw %}
{% if distro_package_manager == 'yum' %}
{% endraw %}
RUN sed -i \
-e "s|http://{{ nodepool_mirror_host }}/opensuse|http://download.opensuse.org|" \
/etc/yum.repos.d/crmsh.repo \
&& sed -i \
-e "s|{{ nodepool_cbs_centos_proxy }}|https://cbs.centos.org/repos|g" \
/etc/yum.repos.d/opendaylight.repo \
&& sed -i \
-e "s|^#baseurl|baseurl|g" \
/etc/yum.repos.d/CentOS-OpsTools.repo
{% raw %}
{% endif %}
{% elif base_package_type == 'deb' %}
{% if base_distro == "debian" %}
{% endraw %}
RUN sed -i -e "s|\[trusted=yes\] http://{{ nodepool_mirror_host }}|http://deb.debian.org|" \
-e "s|\[trusted=yes\] http://{{ nodepool_mirror_host }}|http://security.debian.org|" \
/etc/apt/sources.list
{% raw %}
{% elif base_distro == "ubuntu" %}
{% endraw %}
RUN sed -i -e "s|\[trusted=yes\] http://{{ nodepool_mirror_host }}/ubuntu/|mirror://mirrors.ubuntu.com/mirrors.txt|" \
-e "s|\[trusted=yes\] http://{{ nodepool_mirror_host }}/ubuntu-cloud-archive|http://ubuntu-cloud.archive.canonical.com/ubuntu|" \
-e "s|\[trusted=yes\] http://{{ nodepool_mirror_host }}/ubuntu-ports|http://ports.ubuntu.com|" \
/etc/apt/sources.list
{% raw %}
{% endif %}
{% endif %}
{% endblock %}
{% endraw %}
|