openvswitch-netcontrold image tries to install Python package into system directories. In Debian 12 'bookworm' it is forbidden way.
Image needs to be changed to use virtualenv and install package there.
Build log:
INFO:kolla.common.utils.openvswitch-netcontrold:Step 1/5 : FROM book2m/openvswitch-base:debian
INFO:kolla.common.utils.openvswitch-netcontrold: ---> be60c6b3abf2
INFO:kolla.common.utils.openvswitch-netcontrold:Step 2/5 : LABEL maintainer="Kolla Project (https://launchpad.net/kolla)" name="openvswitch-netcontrold" build-date="20230622"
INFO:kolla.common.utils.openvswitch-netcontrold: ---> Running in 4fce0143fd5b
INFO:kolla.common.utils.openvswitch-netcontrold:Removing intermediate container 4fce0143fd5b
INFO:kolla.common.utils.openvswitch-netcontrold: ---> dc9f80026b75
INFO:kolla.common.utils.openvswitch-netcontrold:Step 3/5 : RUN SETUPTOOLS_USE_DISTUTILS=stdlib python3 -m pip --no-cache-dir install --upgrade pip wheel setuptools && SETUPTOOLS_USE_DISTUTILS=stdlib python3 -m pip --no-cache-dir install --upgrade netcontrold
INFO:kolla.common.utils.openvswitch-netcontrold: ---> Running in 78cbd80062d1
INFO:kolla.common.utils.openvswitch-netcontrold:.[91merror: externally-managed-environment
INFO:kolla.common.utils.openvswitch-netcontrold:× This environment is externally managed
INFO:kolla.common.utils.openvswitch-netcontrold:╰─> To install Python packages system-wide, try apt install
INFO:kolla.common.utils.openvswitch-netcontrold: python3-xyz, where xyz is the package you are trying to
INFO:kolla.common.utils.openvswitch-netcontrold: install.
INFO:kolla.common.utils.openvswitch-netcontrold:
INFO:kolla.common.utils.openvswitch-netcontrold: If you wish to install a non-Debian-packaged Python package,
INFO:kolla.common.utils.openvswitch-netcontrold: create a virtual environment using python3 -m venv path/to/venv.
INFO:kolla.common.utils.openvswitch-netcontrold: Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
INFO:kolla.common.utils.openvswitch-netcontrold: sure you have python3-full installed.
INFO:kolla.common.utils.openvswitch-netcontrold:
INFO:kolla.common.utils.openvswitch-netcontrold: If you wish to install a non-Debian packaged Python application,
INFO:kolla.common.utils.openvswitch-netcontrold: it may be easiest to use pipx install xyz, which will manage a
INFO:kolla.common.utils.openvswitch-netcontrold: virtual environment for you. Make sure you have pipx installed.
INFO:kolla.common.utils.openvswitch-netcontrold:
INFO:kolla.common.utils.openvswitch-netcontrold: See /usr/share/doc/python3.11/README.venv for more information.
INFO:kolla.common.utils.openvswitch-netcontrold:note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
INFO:kolla.common.utils.openvswitch-netcontrold:hint: See PEP 668 for the detailed specification.
INFO:kolla.common.utils.openvswitch-netcontrold:.[0m
INFO:kolla.common.utils.openvswitch-netcontrold:Removing intermediate container 78cbd80062d1
ERROR:kolla.common.utils.openvswitch-netcontrold:Error'd with the following message
ERROR:kolla.common.utils.openvswitch-netcontrold:The command '/bin/sh -c SETUPTOOLS_USE_DISTUTILS=stdlib python3 -m pip --no-cache-dir install --upgrade pip wheel setuptools && SETUPTOOLS_USE_DISTUTILS=stdlib python3 -m pip --no-cache-dir install --upgrade netcontrold' returned a non-zero code: 1
Reason:
python-pip (23.0+dfsg-2) unstable; urgency=medium
This version of pip introduces PEP 668 support. Debian's python3.11 MANAGED, instructing pip to disallow package installation outside
interpreter will soon (>= 3.11.2-3) declare the installation to be
EXTERNALLY-
virtualenvs.
See: https:/ /peps.python. org/pep- 0668/
Practically, this means that you can't use pip to install packages outside a
virtualenv, on Debian's Python interpreter by default, any more.
You can override this behaviour by passing --break- system- packages to pip
install, but be aware that if you are running pip as root, doing so can
break your system.
See /usr/share/ doc/python3. 11/README. venv for more details.
-- Stefano Rivera <email address hidden> Sun, 05 Feb 2023 13:01:43 -0400