Fix pip install cross-distro compat: use ENV PIP_BREAK_SYSTEM_PACKAGES=1

--break-system-packages was added in pip 23 (Debian Bookworm). Ubuntu 22.04
ships pip 22 which rejects the flag with exit code 2. Switch to the
PIP_BREAK_SYSTEM_PACKAGES env var instead: recognized by pip>=23, silently
ignored by pip<23 where PEP 668 is not enforced anyway.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-04 00:31:38 -03:00
parent 7006ed1308
commit ccf62dd925
6 changed files with 12 additions and 6 deletions

View File

@@ -5,7 +5,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
python3 python3-pip \
&& rm -rf /var/lib/apt/lists/*
RUN pip3 install --no-cache-dir --break-system-packages flask
ENV PIP_BREAK_SYSTEM_PACKAGES=1
RUN pip3 install --no-cache-dir flask
COPY k8s_honeypot.py /opt/k8s_honeypot.py
COPY entrypoint.sh /entrypoint.sh