aboutsummaryrefslogtreecommitdiff
path: root/docker/macros.j2
diff options
context:
space:
mode:
authorGaël THEROND (Fl1nt) <gael.therond@bitswalk.com>2020-09-17 14:38:21 +0200
committerRadosław Piliszek <radoslaw.piliszek@gmail.com>2020-09-17 13:50:15 +0000
commitb93c40a3635fbce72e48dc29120e50484cba36ca (patch)
treef4a83f50ad713be09684db076ec083d3732fec66 /docker/macros.j2
parent9a9ae6e295301cc8e60f81e62ec8fc9fd12c852b (diff)
downloadkolla-b93c40a3635fbce72e48dc29120e50484cba36ca.tar.gz
kolla-b93c40a3635fbce72e48dc29120e50484cba36ca.zip
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
Diffstat (limited to 'docker/macros.j2')
-rw-r--r--docker/macros.j213
1 files changed, 2 insertions, 11 deletions
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 -%}