From b4dc63ace6f3eefa585de28cc18a77f77b508f6b Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 30 Sep 2025 21:48:00 +0200 Subject: [PATCH] drop pip packages from the image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They don't seem to install: ``` error: externally-managed-environment × This environment is externally managed ╰─> The system-wide python installation should be maintained using the system package manager (apk) only. If the package in question is not packaged already (and hence installable via "apk add py3-somepackage"), please consider installing it inside a virtual environment, e.g.: python3 -m venv /path/to/venv . /path/to/venv/bin/activate pip install mypackage To exit the virtual environment, run: deactivate The virtual environment is not deleted, and can be re-entered by re-sourcing the activate file. To automatically manage virtual environments, consider using pipx (from the pipx package). 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. hint: See PEP 668 for the detailed specification. Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/lib/python3.12/ensurepip/__main__.py", line 5, in sys.exit(ensurepip._main()) ^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/ensurepip/__init__.py", line 284, in _main return _bootstrap( ^^^^^^^^^^^ File "/usr/lib/python3.12/ensurepip/__init__.py", line 200, in _bootstrap return _run_pip([*args, *_PACKAGE_NAMES], additional_paths) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/ensurepip/__init__.py", line 101, in _run_pip return subprocess.run(cmd, check=True).returncode ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/subprocess.py", line 571, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['/usr/bin/python3', '-W', 'ignore::DeprecationWarning', '-c', '\nimport runpy\nimport sys\nsys.path = [\'/tmp/tmpk9h3ixvs/pip-25.0.1-py3-none-any.whl\'] + sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'/tmp/tmpk9h3ixvs\', \'pip\']\nrunpy.run_module("pip", run_name="__main__", alter_sys=True)\n']' returned non-zero exit status 1. Error: while running runtime: exit status 1 ``` Ref: https://github.com/curl/curl-container/actions/runs/18084279232/job/51452471235#step:7:6234 --- Containerfile | 4 ---- create_dev_image.sh | 4 ---- requirements.txt | 6 ------ 3 files changed, 14 deletions(-) delete mode 100644 requirements.txt diff --git a/Containerfile b/Containerfile index 30494a0..0e13d62 100644 --- a/Containerfile +++ b/Containerfile @@ -13,8 +13,4 @@ from quay.io/buildah/stable:latest RUN dnf --nodocs --setopt install_weak_deps=false -y install less git make podman qemu qemu-user-static buildah clamav clamav-freshclam -COPY requirements.txt requirements.txt -RUN python3 -m ensurepip -RUN pip3 install --no-input -r requirements.txt - WORKDIR /opt/app-root/src/ diff --git a/create_dev_image.sh b/create_dev_image.sh index ce4f871..3762284 100755 --- a/create_dev_image.sh +++ b/create_dev_image.sh @@ -88,10 +88,6 @@ fi # install curl in /build buildah run $bdr make DESTDIR="/build/" install -j$(nproc) -# install useful dev deps¡ -buildah run $bdr python3 -m ensurepip -#buildah run $bdr pip3 --no-input install -r ./requirements.txt - # label image buildah config --label org.opencontainers.image.source="https://github.com/curl/curl-container" $bdr buildah config --label org.opencontainers.image.description="minimal dev image for curl" $bdr diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 047213b..0000000 --- a/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -pytest -pytest-cov -pytest-sugar -factory-boy -lxml -behave \ No newline at end of file