93 lines
4.0 KiB
Django/Jinja
93 lines
4.0 KiB
Django/Jinja
{% raw %}
|
|
{% extends parent_template %}
|
|
|
|
{% block base_header %}
|
|
{% endraw %}
|
|
|
|
ENV PIP_INDEX_URL {{ nodepool_pypi_mirror }}
|
|
ENV PIP_TRUSTED_HOST {{ nodepool_mirror_host }}
|
|
|
|
RUN echo registry={{ nodepool_npmjs_proxy }} > /etc/npmrc \
|
|
&& mkdir -p /usr/etc \
|
|
&& ln -s /etc/npmrc /usr/etc/npmrc
|
|
|
|
{% raw %}
|
|
{% if base_distro == 'ubuntu' %}
|
|
|
|
# NOTE(hrw): Debian 'buster' and Ubuntu 18.04 refuse to use unsigned repos
|
|
RUN echo 'APT::Get::AllowUnauthenticated "true";' > /etc/apt/apt.conf.d/99allow-unauthenticated \
|
|
&& echo 'Acquire::AllowInsecureRepositories "true";' > /etc/apt/apt.conf.d/99allow-insecure-repos
|
|
|
|
{% elif base_distro == 'centos' %}
|
|
{% endraw %}
|
|
|
|
RUN sed -i -e "/^mirrorlist/d" \
|
|
-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-Base.repo
|
|
|
|
{% raw %}
|
|
{% elif base_distro == 'oraclelinux' %}
|
|
{% endraw %}
|
|
|
|
RUN sed -i -e "s|^baseurl=https://yum$ociregion.oracle.com/repo/OracleLinux|baseurl={{ nodepool_oraclelinux_proxy }}|" \
|
|
/etc/yum.repos.d/oracle-linux-ol7.repo
|
|
|
|
{% raw %}
|
|
{% endif %}
|
|
{% endblock %}
|
|
|
|
{% block base_footer %}
|
|
{% if base_distro == "centos" %}
|
|
{% endraw %}
|
|
|
|
RUN sed -i -e "/^mirrorlist/d" \
|
|
-e "/^metalink/d" \
|
|
-e "s|^#baseurl=http://download.fedoraproject.org/pub|baseurl=http://{{ nodepool_mirror_host }}|g" \
|
|
-e "s|^baseurl=http://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|g" \
|
|
-e "s|^baseurl=https://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|g" \
|
|
-e "s|^#baseurl=http://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|g" \
|
|
-e "s|^#baseurl=https://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|g" \
|
|
-e "s|^baseurl=https://packages.elastic.co|baseurl={{ nodepool_elastic_proxy }}|g" \
|
|
-e "s|^baseurl=https://packagecloud.io/grafana|baseurl={{ nodepool_grafana_proxy }}|g" \
|
|
-e "s|^baseurl=https://trunk.rdoproject.org|baseurl=http://{{ nodepool_rdo_proxy }}|g" \
|
|
-e "s|^baseurl=https://cbs.centos.org/repos|baseurl={{ nodepool_cbs_centos_proxy }}|g" \
|
|
-e "s|https://repo.percona.com|{{ nodepool_percona_proxy }}|g" \
|
|
/etc/yum.repos.d/*.repo
|
|
|
|
{% raw %}
|
|
{% elif base_distro == "oraclelinux" %}
|
|
{% endraw %}
|
|
|
|
RUN sed -i -e "/^mirrorlist/d" \
|
|
-e "/^metalink/d" \
|
|
-e "s|^#baseurl=http://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|g" \
|
|
-e "s|^#baseurl=https://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|g" \
|
|
-e "s|^#baseurl=http://download.fedoraproject.org/pub|baseurl=http://{{ nodepool_mirror_host }}|g" \
|
|
-e "s|^baseurl=http://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|g" \
|
|
-e "s|^baseurl=https://mirror.centos.org|baseurl=http://{{ nodepool_mirror_host }}|g" \
|
|
-e "s|^baseurl=https://packages.elastic.co|baseurl={{ nodepool_elastic_proxy }}|g" \
|
|
-e "s|^baseurl=https://packagecloud.io/grafana|baseurl={{ nodepool_grafana_proxy }}|g" \
|
|
-e "s|^baseurl=https://trunk.rdoproject.org|baseurl=http://{{ nodepool_rdo_proxy }}|g" \
|
|
-e "s|^baseurl=https://cbs.centos.org/repos|baseurl={{ nodepool_cbs_centos_proxy }}|g" \
|
|
-e "s|https://repo.percona.com|{{ nodepool_percona_proxy }}|g" \
|
|
/etc/yum.repos.d/*.repo
|
|
|
|
{% raw %}
|
|
{% elif base_distro == "ubuntu" %}
|
|
{% endraw %}
|
|
|
|
## TODO(yoctozepto): replace base repo earlier as well (like RHEL-based do)
|
|
RUN sed -i -e "s|http://archive.ubuntu.com|http://{{ nodepool_mirror_host }}|" \
|
|
-e "s|http://ubuntu-cloud.archive.canonical.com/ubuntu|http://{{ nodepool_mirror_host }}/ubuntu-cloud-archive|" \
|
|
-e "s|http://repo.percona.com|{{ nodepool_percona_proxy }}|" \
|
|
/etc/apt/sources.list \
|
|
&& apt-get update
|
|
|
|
{% raw %}
|
|
{% endif %}
|
|
{% endblock %}
|
|
{% endraw %}
|