From ca16f7ae7da77102db2c1d533c401094479fe1ae Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Mon, 20 Mar 2023 17:42:33 +0100 Subject: docker: use python3-venv to create virtual env Debian 'bookworm' does not like when someone installs Python packages into system directories. So instead of installing 'virtualenv' from pip we move to use 'python3 -m venv' which we install from distribution repositories (on Debian/Ubuntu as EL9 has it in base 'python3'). Change-Id: I7092b561d81c362ca24f84a3d753e777e5625ab3 --- docker/kolla-toolbox/Dockerfile.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docker/kolla-toolbox') diff --git a/docker/kolla-toolbox/Dockerfile.j2 b/docker/kolla-toolbox/Dockerfile.j2 index b3d147458..073cc8f02 100644 --- a/docker/kolla-toolbox/Dockerfile.j2 +++ b/docker/kolla-toolbox/Dockerfile.j2 @@ -48,13 +48,13 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build 'libxslt1-dev', 'openvswitch-switch', 'python3-dev', + 'python3-venv', 'rabbitmq-server', ] %} {% endif %} {{ macros.install_packages(kolla_toolbox_packages | customizable("packages")) }} {% set kolla_toolbox_pip_virtualenv_packages = [ - 'virtualenv' ] %} {% block kolla_toolbox_upper_constraints %} @@ -62,7 +62,7 @@ RUN mkdir -p /requirements \ && curl -o /requirements/upper-constraints.txt ${UPPER_CONSTRAINTS_FILE:-https://releases.openstack.org/constraints/upper/{{ openstack_release }}} \ && sed -e "/^openstacksdk/d" -i /requirements/upper-constraints.txt \ && {{ macros.install_pip(kolla_toolbox_pip_virtualenv_packages | customizable("pip_virtualenv_packages")) }} \ - && virtualenv --system-site-packages {{ virtualenv_path }} + && python3 -m venv --system-site-packages {{ virtualenv_path }} {% endblock %} ENV PATH {{ virtualenv_path }}/bin:$PATH -- cgit v1.2.3