From b93c40a3635fbce72e48dc29120e50484cba36ca Mon Sep 17 00:00:00 2001 From: "Gaƫl THEROND (Fl1nt)" Date: Thu, 17 Sep 2020 14:38:21 +0200 Subject: Improve pip install process for offline deployment. * "Use distribution-provided pip" * "Use python's pip module invocation method" * "Install pip earlier in order to avoid multiple installation" * "Remove pip_version variable requirement and call" Change-Id: Id0e738044a1931f9d611a7281a48ea4a593f1cf1 Closes-bug: #1893204 --- docker/macros.j2 | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'docker/macros.j2') diff --git a/docker/macros.j2 b/docker/macros.j2 index efeac9b81..56dd1414a 100644 --- a/docker/macros.j2 +++ b/docker/macros.j2 @@ -32,18 +32,9 @@ {% endif %} {%- endmacro %} -{% macro get_pip() %} -RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \ - && python3 get-pip.py \ - && rm get-pip.py -{% endmacro %} - -{% macro install_pip(packages, constraints = true, pip_version = pip) %} +{% macro install_pip(packages, constraints = true) %} {%- if packages is sequence and packages|length > 0 -%} -{%- if not pip_version -%} - {%- set pip_version = 'pip' -%} -{%- endif -%} - {{ pip_version }} --no-cache-dir install --upgrade{{ ' ' }} + python{{ distro_python_version }} -m pip --no-cache-dir install --upgrade{{ ' ' }} {%- if constraints %}-c /requirements/upper-constraints.txt {% endif -%} {{ packages | join(' ') }} {%- else -%} -- cgit v1.2.3