From 9abad60280389726cff39beb7c004c86413ab5f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ricks?= Date: Mon, 10 Jul 2023 11:05:21 +0200 Subject: [PATCH] Fix: Fix building container image on Debian bookworm With Debian 12 (bookworm) it isn't possible to use pip to install Python packages system wide because auf [PEP 668](https://peps.python.org/pep-0668). Therefore it requires the `--break-system-packages` switch or to use a virtual environment. --- .docker/prod.Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.docker/prod.Dockerfile b/.docker/prod.Dockerfile index 2d53938c..763c0c41 100644 --- a/.docker/prod.Dockerfile +++ b/.docker/prod.Dockerfile @@ -19,8 +19,8 @@ RUN apt-get update && \ apt-get remove --purge --auto-remove -y && \ rm -rf /var/lib/apt/lists/* -RUN python -m pip install --upgrade pip && \ - python3 -m pip install poetry +RUN python3 -m pip install --upgrade --break-system-packages pip && \ + python3 -m pip install --break-system-packages poetry RUN rm -rf dist && poetry build -f wheel @@ -64,7 +64,7 @@ RUN mkdir -p /run/ospd && \ COPY --from=builder /source/dist/* /ospd-openvas/ -RUN python3 -m pip install /ospd-openvas/* +RUN python3 -m pip install --break-system-packages /ospd-openvas/* RUN apt-get purge -y gcc python3-dev && apt-get autoremove -y