@@ -28,9 +28,10 @@ RUN echo 'APT::Get::AllowUnauthenticated "true";' > /etc/apt/apt.conf.d/99allow-
28
28
{% endraw %}
29
29
30
30
RUN sed -i \
31
- -e "/^ mirrorlist/ d " \
31
+ -e "s|^\( mirrorlist.*\)|#\1| " \
32
32
-e "s|^#baseurl=http://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|" \
33
33
/etc/yum.repos.d/CentOS-*.repo
34
+
34
35
{% raw %}
35
36
{% endblock %}
36
37
@@ -45,14 +46,14 @@ RUN sed -i \
45
46
{% block base_centos_repo_overrides_post_yum %}
46
47
{% endraw %}
47
48
&& sed -i \
48
- -e "/^ mirrorlist/ d " \
49
+ -e "s|^\( mirrorlist.*\)|#\1| " \
49
50
-e "s|^#baseurl=http://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|" \
50
51
-e "s|^#baseurl=https://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|" \
51
52
-e "s|^baseurl=http://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|" \
52
53
-e "s|^baseurl=https://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|" \
53
54
/etc/yum.repos.d/CentOS-*.repo \
54
55
&& sed -i \
55
- -e "/^ metalink/ d " \
56
+ -e "s|^\( metalink.*\)|#\1| " \
56
57
-e "s|^#baseurl=http://download.fedoraproject.org/pub|baseurl=http://{{ nodepool_mirror_host }}|" \
57
58
-e "s|^#baseurl=https://download.fedoraproject.org/pub|baseurl=http://{{ nodepool_mirror_host }}|" \
58
59
/etc/yum.repos.d/epel*.repo \
@@ -79,4 +80,53 @@ RUN sed -i -e "s|mirror://mirrors.ubuntu.com/mirrors.txt|http://{{ nodepool_mirr
79
80
{% raw %}
80
81
{% endif %}
81
82
{% endblock %}
83
+
84
+ {# Revert to upstream mirrors after build is complete #}
85
+
86
+ {% block footer %}
87
+ {% endraw %}
88
+
89
+ ENV PIP_INDEX_URL=
90
+ ENV PIP_TRUSTED_HOST=
91
+ {% if use_infra_wheels_mirror | default (true ) %}
92
+ ENV PIP_EXTRA_INDEX_URL=
93
+ {% endif %}
94
+
95
+ RUN if [[ -f /usr/etc/npmrc ]]; then \
96
+ unlink /usr/etc/npmrc; \
97
+ fi \
98
+ && rm -f /etc/npmrc
99
+
100
+ {% raw %}
101
+ {% if base_package_type == 'rpm' %}
102
+ {% endraw %}
103
+ RUN sed -i \
104
+ -e "s|^#\(mirrorlist.*\)|\1|" \
105
+ -e "s|^baseurl=http://{{ nodepool_mirror_host }}|#baseurl=http://mirror.centos.org|" \
106
+ /etc/yum.repos.d/CentOS-*.repo \
107
+ && sed -i \
108
+ -e "s|^#\(metalink.*\)|\1|" \
109
+ -e "s|^baseurl=http://{{ nodepool_mirror_host }}|baseurl=http://download.fedoraproject.org/pub|" \
110
+ /etc/yum.repos.d/epel*.repo
111
+ {% raw %}
112
+ {% elif base_package_type == 'deb' %}
113
+ {% endraw %}
114
+ RUN rm -f /etc/apt/apt.conf.d/99allow-unauthenticated /etc/apt/apt.conf.d/99allow-insecure-repos
115
+ {% raw %}
116
+ {% if base_distro == "debian" %}
117
+ {% endraw %}
118
+ RUN sed -i -e "s|http://{{ nodepool_mirror_host }}|http://deb.debian.org|" \
119
+ -e "s|http://{{ nodepool_mirror_host }}|http://security.debian.org|" \
120
+ /etc/apt/sources.list
121
+ {% raw %}
122
+ {% elif base_distro == "ubuntu" %}
123
+ {% endraw %}
124
+ RUN sed -i -e "s|http://{{ nodepool_mirror_host }}/ubuntu/|mirror://mirrors.ubuntu.com/mirrors.txt|" \
125
+ -e "s|http://{{ nodepool_mirror_host }}/ubuntu-cloud-archive|http://ubuntu-cloud.archive.canonical.com/ubuntu|" \
126
+ -e "s|http://{{ nodepool_mirror_host }}/ubuntu-ports|http://ports.ubuntu.com|" \
127
+ /etc/apt/sources.list
128
+ {% raw %}
129
+ {% endif %}
130
+ {% endif %}
131
+ {% endblock %}
82
132
{% endraw %}
0 commit comments